Collision "problem"

Blitz3D Forums/Blitz3D Programming/Collision "problem"

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I had a similar problem where particular entities were involved in more than one collision in the same UpdateWorld. As the code cycled through each collision, created an explosion and freed the entity, it would give me an "Entity Doesn't Exist" error.

The solution? Rather than delete the collision entities in your main program, add them to an array. Create a function called ActOnCollisions() and call it before UpdateWorld. Cycle through the array and remove duplicate entities. Cycle through again and delete the entities... No more "Entity Doesn't Exist" errors.