Godot Version
4.2.2
Hey, I’m trying to implement a few character animations, the specific one I’m having is one called “Rolling” like the metroid ball thing. Anyway, while my Idle and Running animations work fine my rolling one dosen’t. I figure maybe it because the section where the animations code is getting confused but I’m not exactly a great programmer here.
func update_animations(direction, delta):
if direction != 0 and not is_crouching:
animated_sprite_2d.flip_h = (direction < 0)
animated_sprite_2d.play("Running")
else:
animated_sprite_2d.play("Idle Animation")
if is_crouching:
if direction == 0:
animated_sprite_2d.play("Duck")
elif direction != 0:
animated_sprite_2d.flip_h = (direction < 0)
animated_sprite_2d.play("Rolling")
if not is_on_floor():
if velocity.y < 0:
animated_sprite_2d.play("Jump")
else:
animated_sprite_2d.play("Fall")
if is_wall_sliding and not is_on_floor():
animated_sprite_2d.flip_h = (direction > 0)
animated_sprite_2d.play("WallGrab")