Quick Question About Player Movement And Animations. Please Help!

I am Just Wondering How I can get My player to play an animation when I rotate him left or right with the mouse?

can’t say I actually checked that this script works but something like this?

 public float mousepos = 0;
 public Animation anim;

void Start()
    anim = gameObject.GetComponent<Animation>();

    void Update()
    float x = Input.mousePosition.x;
    if(x < mousepos) //left
    if(x > mousepos) //right
    mousepos = x;

if (Input.GetMouseButton(0)){
transform.Rotate(new Vector3(0.0f, Input.GetAxis(“Mouse X”), 0.0f) * -rotationSpeed);

depends on what animation it is and how it should behave and interact with other animations.

this is a huge topic, and your question is too generic.

and the answers you gothere are weak obsolete ugly crap.

go look up some animator state machine/mecanim tutorials instead.