Hi guys, I’m totally new with this world, I’m an artist and wont to learn some basic programming, can someone please explain me how to program an animation that syncs with the actual object velocity? I have this character with idle, walk, run animation for every direction and I set up the animation graph properly now I just don’t know how to put the 2 variables of the blend tree “hvel” and “vvel “ in the script to make the animation behave the way I want, I’ve used an addforce command to make the character move with some sliding to make the animation and the movement feel more natural but the animation doesn’t follow the movement speed and neither the actual direction of the movement and sliding, what can I do? Can someone send me and example script so I can see where I’ve done the mistake? Also I’m from Italy so my English is not one of the best but I’ll try my best to explain myself.
Have you seen tutorials on the Animator and Blend Trees?
These tutorials usually show how to do implement blending between a walk and a run animation by the character’s velocity. You can input the velocity via script by using animator.SetFloat("hvel", 1.5f)
, for example.
Best post your script code here, so we can look for mistakes.
1 Like