I am following this tutorial:
and, at 14:39, Where he starts scripting the camera mouse rotation, my script does not work
this is my code:
if (Input.GetMouseButton(2))
{
rotStartPos = Input.mousePosition;
}
if (Input.GetMouseButton(2))
{
rotCurrentPos = Input.mousePosition;
Vector3 difference = rotStartPos - rotCurrentPos;
rotStartPos = rotCurrentPos;
newRot *= Quaternion.Euler(Vector3.up * (-difference.x / 5f));
}
I also find it strange of getting the difference of the same Vectors of therotStartPos - rotCurrentPos So, is there a way to fix it?