Jump to content

Recommended Posts

Posted

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!

Posted

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?

Posted

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 ;)

Posted

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...