Godot Version
4.4.1-stable-mono C# version
Hello, I’m new to Godot and I would need some help with my animations in my 3D Game.
As you can see here my animations snap a lot and it looks like it goes back to the beginning of the animation from time to time.
I also have the issue that if I stop turning(stop pressing key) the animation is coming back to a previous frame kind of.
This is the animation three that I’m using :
This is the blendSpace2D FreeRun(the one having issue)
And this is my code to update animation :
// Handle rotation
if (Input.IsActionPressed(InputConstant.MOVE_LEFT))
{
owner.RotateY(RotationSpeed * delta);
owner.UpdateAnimation(new Vector2(1, 0), "Free Run");
isMoving = true;
}
if (Input.IsActionPressed(InputConstant.MOVE_RIGHT))
{
owner.RotateY(-RotationSpeed * delta);
owner.UpdateAnimation(new Vector2(-1, 0), "Free Run");
isMoving = true;
}
// Handle forward/backward movement
if (Input.IsActionPressed(InputConstant.MOVE_FORWARD))
{
direction = -owner.Transform.Basis.Z;
owner.UpdateAnimation(new Vector2(0, -1), "Free Run");
isMoving = true;
}
else if (Input.IsActionPressed(InputConstant.MOVE_BACKWARD))
{
direction = owner.Transform.Basis.Z;
owner.UpdateAnimation(new Vector2(0, 1), "Free Run");
isMoving = true;
}
It is called every frame in my _Process function
Update animation contain only and update of the blendSpace
public void UpdateAnimation(Vector2 blendPosition, string animationName)
{
// Set the blend position on the BlendSpace2D
animationTree.Set($"parameters/{animationName}/blend_position", blendPosition.Normalized());
}
The animations are from Mixamo if that play a role.
Can someone help me figure out why my animation has those 2 problems ?
Thanks in Advance