How can I introduce a turning function for my player in this script?

Hi,
I have this script:

public float speed = 1.0f;
    Vector3 movement;
    Animator anim;
    Rigidbody playerRigidbody;
    
  

    void Awake ()
    {

        
        anim = GetComponent<Animator>();
        playerRigidbody = GetComponent<Rigidbody> ();

    }

	
	// Update is called once per frame
	void FixedUpdate ()

    {

        float h = Input.GetAxisRaw ("Horizontal");
        float v = Input.GetAxisRaw ("Vertical");
        Move (h, v);
        Animating (h, v);
       




    }


    void Move (float h, float v)
    {

        movement.Set(h, 0f, v);
        movement = movement.normalized * speed * Time.deltaTime;
        playerRigidbody.MovePosition(transform.position + movement);




    }

    void Animating (float h, float v)
    {

        bool walking = h != 0f || v != 0f;
        anim.SetBool ("IsWalking", walking);



    }



    




}

I have been struggling for some time to work with mecanim and playing animations while my player moves. This script works very well in that respect, however, I can’t seem to get the player to turn using the “a” and “d” keys. I have tried using the simple functions:

transform.Rotate(Vector3.up, turnspeed * Time.deltaTime);

However, even with that line this object will not turn, I do not know if the script I currently have is interfering with this function or if there is something else that needs to be done. Thank you for your time.

Good day.

Please note Vector3.up maybe is not what you think. I recoomend you to look at the inspector what component (x, y ,z) you want to rotate, and use this:

transform.Rotate(new Vector3 (0,0,0), turnspeed * Time.deltaTime);

Of course, replacing some of the 0 for a 1 at the axis you want to rotate. (If you are not sure, try it 3 times, one for each)

Bye!