Hello, I’m testing animations, the thing is that I have a running jump animation, but it gives me some kind of error with the jump physics in my c# file.
The animation looks something like this (gif).
As you can see, when you jump you take the physics of the animation, and then my physics, the ones I did in c#.
My jump code:
if (Input.GetButtonDown("Jump"))
{
IsJumping = true;
jumpTimeCounter = jumpTime;
moveDirection.y = jumpSpeed;
Animator.SetBool("jumping", true);
CreateDust();
}
}
if (Input.GetButton("Jump") && IsJumping == true)
{
if(jumpTimeCounter > 0)
{
moveDirection.y = jumpSpeed;
jumpTimeCounter -= Time.deltaTime;
Animator.SetBool("jumping", true);
CreateDust();
}
else
{
IsJumping = false;
}
}