Hello,
I’m using the 2D AC Player to manage direction, the animator, handle cutscenes, hotspots and I have a custom script for managing my character’s attacks. Similar to the game The Binding of Isaac, when the player presses the up button, they attack upward, pressing the right button attacks to the right, and so on for all four directions.
During an attack my script forces the Player’s direction to orient them in the direction of the attack using:
player.SetSpriteDirection(CharDirection.Up); // to attack upwards
player.SetSpriteDirection(CharDirection.Right); // to attack to the right
...
It's working.
My issue is that after the attack, even though the player can move in all four directions, the sprite remains locked in the last SetSpriteDirection direction.
How can I reset the sprite’s direction?
I’ve tried using ResetAnimator(), but it hasn’t worked.
Thanks.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @Styval.
This should just be a case of setting the Player's lockDirection flag to false:
It works perfectly.
Thanks Chris!