I am making code for camera movement but I getting this error.
System.NullReferenceException: Object reference not set to an instance of an object
at MouseHandler.Update () [0x0005c] in C:\Users\mms27\A Test Thing\Assets\FirstPersonMovementDemo\Scripts\MouseHandler.cs:27
the code is here in this code tag.
cam.transform.eulerAngles = new Vector3(xRotation, yRotation, 0.0f);
Expect to see this error a LOT. It’s easily the most common thing to do when working. Learn how to fix it rapidly. It’s easy. See the above link for more tips.
This is the kind of mindset and thinking process you need to bring to this problem: