Mecanim and rotating char issue

How do i actually make a character rotate in the spot where it is? Atm i’m using this script[1] that is a copy and paste from different sources and it doesn’t do what it should (in my head). If i walk and then at the same time press a or d to turn the char continues forward, as intended, but slides on the ground not turning at all. Pressing either a or d while idle slides the char across the ground.

[1] http://pastebin.com/4vENN8sH

To make a character rotate, the best way to do it in my opinion is to just animate the rotation. In your animation program, Make his legs move, rotate his root object, etc. It looks and acts way better than just spinning in place.

edit

double post

My issue isn’t the animation atm. It’s the fact that the character is sliding/gliding along the X-axis on the map and not rotating in the spot he stopped at.

Make sure you’ve baked the character into the pose on the X, Y, and Z axis and set the position to “original”

Managed to get the rotation to work as i wanted but i still have problems…

Using walk animation clip from this: http://www.youtube.com/watch?v=Xx21y9eJq1U
Using soldier from this pack: Soldier Character Pack | 3D Humanoids | Unity Asset Store
This script for the soldier: http://pastebin.com/2XwXmKYZ
Soldier settings: Imgur: The magic of the Internet

Result is this: http://www.youtube.com/watch?v=RWM9JXEpcas

What am i doing wrong?

Surely someone knows what the issue is with my script.

Not sure if your new to it like me, but this really helped out loads: