Rotate Player using mouse?

I am having trouble with rotating the player with where the mouse is. I dont know what to do

Hi,
Use below mention code, it should be helpful for rotate player using mouse.
#pragmastrict
varspeed : float = 10.0; //changevalueofspeedforfastrotation

functionUpdate()
{
transform.Rotate(Vector3(Input.GetAxis(“MouseY”), Input.GetAxis(“MouseX”), 0)*Time.deltaTime *speed);
}
Thanks

1 Like

Here’s one of multiple premade assets you can use for mouse look http://wiki.unity3d.com/index.php/SmoothMouseLook

A quick Google search would have yielded dozens of results on the subject as well :slight_smile:

1 Like

Thanks really helped