Godot Version
Godot 4.2.1
Question
So, I’ve been following a tutorial online for a 2D top-down rpg and I have a simple, empty world scene with a player character and a skeleton. Everything is mostly working. The player moves, and animates correctly (I’m using AnimationTree and AnimationPlayer). The skeleton chases the player and animates correctly from idle to walking, changes direction, etc. The skeleton has a detection range (Area2D) and when it detects the player it moves towards it. The player is faster than the skeleton, so they can move out of range and return to be chased all over again…
The weirdness is when the player approaches the skeleton while facing north. That is: player is facing north, skeleton has detected the player and is facing south to chase them. All normal. But oddly, once they collide, the skeleton sticks to the player and then begins to move at the pace of the player? I can’t see that I’m doing anything different in either the skeleton script or the player script for the specific case of the skeleton moving south - I mean compared to the other three directions. And, just to repeat, this doesn’t happen in any of those other directions. I’m puzzled.
Things I’ve tried:
I hiked up the player speed and reduced the skeleton velocity to zero. I literally did this in the skeleton’s _physics_process function
velocity = Vector2.ZERO
move_and_slide()
And it still happens!
When I comment out move_and_slide() it doesn’t happen though.
Is there some way the skeleton’s velocity could be being changed by the framework?
It might help to add that although, obviously, I have added the skeleton scene to the world scene, I’m not instantiating the skeleton class anywhere else in my code.
I appreciate that I haven’t included enough code here for people to be able to solve this problem. I’m just wondering if anyone has seen anything similar?