3D Jumping Animation Issues

Godot Version 4.2.1

I’m making a Character & Camera controller for a platformer and the jump animation is giving me issues. The walk & idle animations work and loop as/when they should. However, when I jump the (jump) animation plays through once then on the second time it just snaps to the (first or last, I’m unsure of which) frame until I hit the ground again, at which it plays the idle or walk depending on horizontal movement. The code to manage the jump as well as my current Animation tree is below

func _physics_process(delta):
	# Add the gravity. Plays Jump
	if not is_on_floor():
		velocity.y -= gravity * delta
		anim_tree.set("parameters/Jump/blend_amount", 1)
		anim_tree.set("parameters/Jump/blend_amount", 0)
	if Input.is_action_just_pressed("jump") and is_on_floor():
		velocity.y = JUMP_VELOCITY

        anim_tree.set("parameters/Run/blend_position", velocity.length() / SPEED)

Make sure that your jump animation is looped or it will play once and stay at the end of the animation forever.

Un-indent the line anim_tree.set("parameters/Run/blend_position"... or it won’t work.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.