Unity Camera Look At Mouse
Edited your script to add a clamp and also move the camera on the x axis up and down and use the transform to move the player body.
Unity camera look at mouse. Generate a ray from the cursor position var ray camera main screenpointtoray input mouseposition. You want the camera to tilt up and down like a head. Public void look look rotation up down is camera left right is transform rotation rotation y. Var playerplane new plane vector3 up transform position.
Modified version of standard assets mouselook cs it moves the camera with an easing effect. Determine the point where the cursor ray intersects the plane. The character already turns. Instantly share code notes and snippets.
Private vector2 rotation vector2 zero. Public float lookspeed 3. Fps camera mouse look controller fps game in unity part 9 duration. This will be the point that the object must look towards to be looking at the mouse.
You want the camera to tilt up and down like a head. Unity script to give camera wasd mouse control.