Documentation about collisions are bit.. thin, so could you give suggestions of best practices with them.
Lets start with bullets and targets (both spherical). I want both object removed when they collide.
I assume I have to check collisons both way, bullet to targets and targets to bullet to find exact objects I want to remove.
So, two loops, one checks and removes bullets that have collided to targets and another to check and remove targets that have been hit by bullet. Problem is that second loop gives sometimes "Entity not found" or such errors, because bullets I previously removed.
Ok, workaround was that I flag 'need to be removed' objects and remove them after all collision checks.. so it works ok now.
Is there way to do this kind of bullet/target with one loop and just using one way check "Collisions TYPE_BULLET,TYPE_BALL,1,1" ?
From what I understand problem might be that I could not get ball object(Type) to be destroyed.. just entity.
Lets start with bullets and targets (both spherical). I want both object removed when they collide.
I assume I have to check collisons both way, bullet to targets and targets to bullet to find exact objects I want to remove.
So, two loops, one checks and removes bullets that have collided to targets and another to check and remove targets that have been hit by bullet. Problem is that second loop gives sometimes "Entity not found" or such errors, because bullets I previously removed.
Ok, workaround was that I flag 'need to be removed' objects and remove them after all collision checks.. so it works ok now.
Is there way to do this kind of bullet/target with one loop and just using one way check "Collisions TYPE_BULLET,TYPE_BALL,1,1" ?
From what I understand problem might be that I could not get ball object(Type) to be destroyed.. just entity.