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


(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


if(character_controller.velocity.x > 2)
if(character_controller.velocity.x < 2)