cancel
Showing results for 
Search instead for 
Did you mean: 

How do you set the Cameras to look at a particular point?

zylick
Level 4
I want to take temporary control of the Cameras to look at a particular point.
I also want to reset them to look a particular direction.
For example,
Lets say I right click on down it hides the cursor and on up it shows the cursor.
No I can do this to make sure the body is going the correct way:


Vector3 fVector3 = new Vector3();
CameraController.GetCameraOrientationEulerAngles(ref fVector3);
PlayerController.transform.rotation = Quaternion.AngleAxis(fVector3.y, Vector3.up);


But how do I get the camera not to snap another x amount of degrees? How do I set the camera back?
1 REPLY 1

zylick
Level 4
I was able to make it so it didn't snap back.
When I snapped the body to the camera location I set a boolean to true. When the offset gets calculated I made it check to see if the variable was true if it was then 0 out the extra offset (In other words, dont' move your head). That works for now.