2D game animation is running


I’m making a 2D game and I have a character with some animations; I need to know in the script which animations are playing in the animator. If he is jumping, walking, attacking or something else.

Thank you :slight_smile:

Hi Aled,

If this is for debugging purposes then you can simply look at the Animator window and you will see what animation is playing by the loading bar on the state. Also as the animation transitions are put into effect by the change in variables and then the act of assigning the variable changes to the variables in the animator you can place Debug.Logs in your scripts.

If it is for the player to see, then see here:

The animator will not give you the animation name, but instead it will give you a number (nameHash), use the number to see the state it is attached to and set up a manager to display the animation that is playing from knowing it’s nameHash.