Godot Version
Godot version 4.2.1.
Question
Hi! So, I have a PathFinding enemy, and once the player is in range, it works perfectly fine. The problem is, that when the game starts, it generates a weird path, and wanders there. I'd like the enemy to just stay put until the player is in range. Any idea why this is happening?
It sounds like your enemy is generating a path and trying to follow it before it has been activated to do so. It should not do any of that before your ‘in range’ indicator is fired. Take a look at your code and find out the state of the enemy at the start of the game. For instance, if you are using a state manager, perhaps you have set the wrong initial state.
The path is being generated before you expect it to, and is doing so with dirty data. I would guess it is finding a path to the point Vector2.ZERO as it has nothing to follow yet.
If you share your enemy code perhaps we could take a look and give you some pointers.