Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Sora1412 |
Hey, So I just started game dev using godot recently and I’m currently making a simple 2d platformer with animatedSprites. and of course there’s a jumping animation
so my problem is in my sprite the jumping animation consist of 5 frames from the character launching to character tucking in midair. So I use all 5 frames and apply the animation when the player press jump on their keyboard. However I notice that if the character is still mid air and the jumping animation is done it will loop the animation back making it awkward, how can I overcome this? is there some sort of way to prevent the animation from looping?
if (IsOnFloor())
{
if (Input.IsActionJustPressed("jump"))
{
velocity.y = -jumpHeight;
GetNode<AnimatedSprite>("AnimatedSprite").Play("jump");
isInAir = true;
}
else
{
isInAir = false;
}
IsDashAvailable = true;
canClimb = true;
}
I’m using C# as the language