Hi there,
MEGA NOOB here (=
A really simple question but I just can’t seem to get it right.
I’m playing around with the animator, I’ve got a parameter “AboutToStop” and I’d like to set it to the velocity of the y axis (float vel) so I can change animation with transitions based on the velocity.
**Thanks in advance ! **
…
Animator anim;
float vel;
void Start()
{
anim = GetComponent<Animator> ();
}
void Update()
{
vel = GetComponents<Rigidbody2D>().velocity.y;
anim.SetFloat ("AboutToStop", vel);
}
…