Hi, Hope somebody can help. I am using the following code to play an animation when the player moves down:
void PlayerMovementVertical()
{
if (moveVelocity.y < 0)
{
if (skeletonAnimation.skeleton.data.FindSkin("Front") != null)
{
skeletonAnimation.skeleton.SetSkin("Front");
skeletonAnimation.state.SetAnimation(0, "Walk_front", true);
}
}
}
(this function is called in Update)
Unfortunately, whilst the arrow is pressed the player moves down but the animation does not play whilst it is moving. However, the animation starts playing when the arrow key is no longer being pressed.
I cannot figure out what is causing the problem. Any help is appreciated.
Thanks