- Home /
Question by
ProfessorWatkins · Jan 19, 2013 at 05:23 PM ·
rotationmouselookclampx axis
Cannot Stop Mouselook camera backflips
void Update () {
float h=Input.GetAxis("Mouse X")*xSpeed;
float v=Input.GetAxis("Mouse Y")*(-ySpeed);
transform.Rotate (0,h,0);
playerCamera.transform.Rotate (v,0,0);
}
This is my current script, it works perfectly, aside from the backflip issue. This script rotates only the camera (the playerCamera variable) along the X-Axis, so I don't know if that's the issue. I have tried Mathf.Clamp in a few places, but that had no effect. Anyway, thanks in advance.
Comment
Your answer
Follow this Question
Related Questions
c# problem with limiting rotation (with rigidbody) 1 Answer
How to stop rotation in x and y axis??? 2 Answers
Rotation - Simple Question 0 Answers
Clamp Rotation Problem 1 Answer
door script problems 2 Answers