I'm making a game, and I've tried to find a solution to this problem but I can't find anything.
So, I'm trying to have different types of enemies in different worlds, but when I kill an enemy in the first world, being that it has the code to remove the other enemies in the other worlds, I get the error: java.lang.IllegalStateException: 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.
I know what the problem is, I just don't know how to fix it/make it work


