Mobile Skater game question

what code do I use to make the skater “leanLeft” during a left rotation and “leanRight” during a right rotation? If you have worked with this tutorial and know the answer please give me some code for this. I have a animation for both leanLeft and LeanRight.

well … you read the object left/right velocity using

character_controller.velocity.x

(note that you must make a variable of CharacterController type named character_controller and then assign the character_controller in the inspector)

and then rotate your character (or play animation) depending on that

example

if(character_controller.velocity.x > 2)
{
     animation.CrossFade("leanRight",0.2);
}
if(character_controller.velocity.x < 2)
{
     animation.CrossFade("leanLeft",0.2);
}