British_Jack Posted March 27, 2014 Share Posted March 27, 2014 Hi, I've been trying to find a way to getting all collisions and destroying them if they are under a specific height. I've tried achieving this via arrays, but i keep getting some weird Access Violation error which only occurs when i try adding the object to the array. Any tips on how to collect them all somehow? thanks! Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 27, 2014 Share Posted March 27, 2014 what do you mean with 'destroying' a collision? Collisions or triggercollision happen in game and cant be destroyed. The objects that have physics elements or are triggerzones can be removed. Can you elaborate a little more on what you are trying to do? Quote Link to comment Share on other sites More sharing options...
British_Jack Posted March 27, 2014 Author Share Posted March 27, 2014 What im trying to do is that any objects that go under a specific height will be deleted. Except i can't think of a way to loop through the objects to do that... Btw, not collisions, objects i meant Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted March 27, 2014 Share Posted March 27, 2014 If is just the height that you want to check on, then you don't need physics. just attach a lua script to the objects that you want to check and in the update function of the script do something like this (pseudoisch): Script function:Update() if self.entity:GetPosition().y < minimumHeight then self.entity:Release() end end Quote Link to comment Share on other sites More sharing options...
British_Jack Posted March 27, 2014 Author Share Posted March 27, 2014 Alright, thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.