Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make my own first person camera controls in unity that use both thumbsticks on a joypad. I have this working fine. However, when I move the right thumb stick (the one uses to look left / right & up / down the camera begins to constantly update.

Here is my joypad movement code:

   // Update is called once per frame
void Update()

    float speed = transform.localEulerAngles.y + Input.GetAxis("LeftRight") * sensitivityX;

    rotationY += Input.GetAxis("UpDown") * sensitivityY;
    rotationY = Mathf.Clamp(rotationY, minimumY, maximumY);

    transform.localEulerAngles = new Vector3(-rotationY, speed, 0);


To control the left thumb stick, I've simply attached the my script to a first person character controller Unity provide.

I know my code is updating every frame, but I assumed that it would only update as and when I press the right thumb stick. If that isn't the case, is there a way I can limit it to only increment when I move the right thumb stick?

share|improve this question
Did you try using Debug.Log to show what the GetAxis call is saying? And check the dead zone values on the input manager? Didn't I suggest this before in a very similar post a few days ago (which has now strangely disappeared)? – Kylotan Feb 21 '13 at 12:28
up vote 2 down vote accepted

Your code looks fine, so I assume the problem is somewhere else. The one I can think of: these axes have very small "Gravity" value in Input Manager (i.e. "Speed in units per second that the axis falls toward neutral when no buttons are pressed", from this page in Unity Manual).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.