Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Jael |
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
My problem:
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 body_entered and body_exited 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?
Can you show your script so that I can help please?
Amateur.game.dev. | 2021-01-15 23:10