- Home /
I need to make the Camera Quit snapping to center...
http://answers.unity3d.com/questions/146546/rotation-with-right-stick.html
This is what i used^ My camera snaps back to the original camera point when i release the joystick.. its like the camera is constantly being pulled back to original position, if i try to turn my camera 180 degrees around i can't... please help me someone?
Answer by Mizuho · Jun 19, 2012 at 08:15 AM
function Update () {
var angH = Input.GetAxis("RightH") * 60;
var angV = Input.GetAxis("RightV") * 45;
Vector3 currentAngles = transform.localEulerAngles;
currentAngles.x += angV;
currentAngles.y += angH;
transform.localEulerAngles = currentAngles;
}
The original code would have angH
and angV
become 0 when you release the thumbstick (ie. Input.GetAxis() returns 0 * (60 or 45) = 0).
Your answer
Follow this Question
Related Questions
Cinemachine Input Provider requires InputActionReference. Any workarounds? 0 Answers
FPS Don't draw mesh, do draw shadows, but mesh needs to be drawn on mirror material. 0 Answers
How to switch between four characters when a button is pressed? 1 Answer
FPS camera script - keeps reverting to 0,0,0 rotation 1 Answer
Rotating a camera that is already rotated on Z axis 0 Answers