Jump to content
AnniXa

Simple way to remove body that are out of the world?

Recommended Posts

Hey, just wanted to ask if there is a quick way to remove all those body that "fell" out of the worldsize (wich i made with SetWorldSize(...))

Share this post


Link to post

What I would do is put a plane at the edge of the world and say

 

if EntityDistance (object,plane) <1 then

FreeEntity (object)

end

 

But i'm a noob, so what do I know haha

Share this post


Link to post

EntityDistance() works on the origin of the entity, so that wouldn't be accurate with such a huge plane.

Since the world is just a huge box, all you need is to check if one of the coordinates is near the size of the world in that direction.

You could also make a physics box and scale it so it is more or less a plane. Then use the collision callback to free any entity that collides with it. Do that for all 6 sides and you have it. Oh and make sure the physics boxes are inside the world, otherwise it won't work.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...