Hello,
I have a run and a jump on a character using mechanim. These animations are “in place.” I’m using curves like in the tutorial and they get my collider to position and scale properly when jump is pressed. However, the collider does not return to its initial position and scale.
My jump animation is not looped and nothing is baked to the poses. I guess since I am using in place anims, I’ll have to lerp the collider?
Here is my code just in case.
if(Input.GetButtonDown("Jump"))
{
anim.SetBool("Jump", true);
}
// if we are in the jumping state...
else if(currentBaseState.nameHash == jumpState)
{
// ..and not still in transition..
if(!anim.IsInTransition(0))
{
if(useCurves)
// ..set the collider height to a float curve in the clip called ColliderHeight
col.height = anim.GetFloat("ColliderHeight");
col.center = new Vector3(0,anim.GetFloat("ColliderUp"),0);
// reset the Jump bool so we can jump again, and so that the state does not loop
anim.SetBool("Jump", false);
}