Forum rules - please read before posting.

How to reset SetSpriteDirection

edited October 2024 in Technical Q&A

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.

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.