You can remove an actor by using the code
but this has given me the error
1 | getWorld().removeObject( this ); |
Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
So I was wondering if there was another way to remove yourself or a way to not make that error pop up.
Btw, the error only pops up if I have a situation similar to this: you have a bullet and it hits an object, then you replace the bullet with a blood splat.
In this situation that error pops up