|
Hi I am trying to activate a fall animation when the character controller is falling to the ground. I can't seem to get it working :/ I was wondering if there was a solution to the problem! Here is the animation code I have written so far function Update () { var controller : CharacterController = GetComponent(CharacterController); }
(comments are locked)
|
|
You can check the y component of the velocity vector and if it is less than 0 (i.e your character is falling down) play the animation. It didn't seem to work :/ I'm using a character controller if that makes any difference to the code you wrote? Also void FixedUpdate() isn't recognised Thank you for your reply aswell :D
Mar 22 '12 at 06:55 PM
Joevis
void is C#. If you using javascript change it to function. You need to add a rigidbody to your character controller. You also need to debug the speed so you can tell if it works.
Mar 22 '12 at 07:06 PM
Meltdown
(comments are locked)
|
