- Home /
Question by
lightpower26 · Sep 01, 2016 at 05:47 AM ·
camerajavascriptfps
How to keep FPS Camera from flipping?
I'm making a little storyline system for myself when I have the sudden urge to make a game based off of a storyline I make up in my head (Sounds dangerous but I enjoy it). One of the key components is the FPS system. Of course, I'm stumped on how to keep the camera from doing front and back flips when you look up and down a lot. Look at this to see what I mean
Apparently, my camera setup is a bit weird. When you look straight, the X rotation is around 0. When you look up, it counts down from 360. When you look down, it goes toward 90. Any ideas on how I would fix this?
Code snippet for camera:
function Update(){
this.transform.Find("Camera").eulerAngles -= Vector3(Input.GetAxis("Mouse Y") * 10, 0, 0);
}
Comment
Your answer
Follow this Question
Related Questions
Set Max Rotation On Weapon Sway 0 Answers
How to make raindrop effects on camera? 2 Answers
Motion Blur Effect for Camera 1 Answer