func land() :
animated_sprite_2d.play(“jump_end”)
animation_lock = true
I do not know why I can not play my animation frames normally , as like as The land() fuciton , That "s three frames i was create , but is only one frame it can play which is frist.
Because first you run the land animation and then in next frame of process, its playing the walk animation. If you still unable to fix then write the codes in proper format:
actually is the problem of jump animation play, i don t why i set up the animation
but it can t be work or the frames work is imperfect , i write a check code to check this like this :
print("Current Animation: ", animated_sprite_2d.animation)
print("Animation Lock: ", animation_lock)
why i start game Current Animation “RUN” and “Idle” be work , but “jump_start” was not,and i wrtie a code like “jump was be used” its printf ,but the animation is t play
To format your code properly, paste it between three ticks like so
```
type or paste code here
```
results in:
type or paste code here
You can click the </> button or ctrl+e in the forum to generate this for you.
It seems like you are always playing either the “RUN” or “Idle” animations, since they are part of _process this will play one of them every frame. You need to avoid playing these ground-based animations while the character is not on the floor.
I set up :if not is_on_floor() :
velocity.y += GRAVITY * delta
was_in_air = true
else :
has_double_jumped = false
if was_in_air == true :
land()
was_in_air = false
I dont why my player under the ground he is still play the function land()
if is_on_floor():
if direction != 0 :
animated_sprite_2d.play(“RUN”)
animated_sprite_2d.flip_h = direction < 0
else:
animated_sprite_2d.play(“Idle”)
...
Actually i do like this
func updating_animation() :
if not animation_lock :
if not is_on_floor() :
animated_sprite_2d.play(“jump_loop”)
else :
if direction.x != 0 :
animated_sprite_2d.play(“RUN”)
else :
animated_sprite_2d.play(“Idle”)