Jump to content

Getting all collisions


British_Jack
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...