Hello! I'm a beginner and I'm making an RPG-type game to test out the engine.
I have an Area2D around the player to detect when an enemy is close enough to reach and attack, and I have another, bigger Area2D around the enemies to detect when the player is nearby and start following/attacking him
I made it so the enemies spawn at random coordinates(when one enemy dies, another is spawned), and sometimes they spawn too close to the player and it doesn't detect the bodyentered and bodyexited because the body is already inside. So the enemies don't follow me and I can't attack them.
Any ideas on how I can fix this?