Basically I'm trying to create a game where the life and score counter in relation to contact with the enemy is controlled in the hero class.
Although, when the level changes to a level that does not have the enemy in it, it says:
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.
So is there a way to say only initiate this method when the actor is in the world?
Any help would be much appreciated. :)
