Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Keyboard input very slow.

Discussion in 'Editor & General Support' started by WarbladerToo, Nov 8, 2014.

  1. WarbladerToo

    WarbladerToo

    Joined:
    Nov 2, 2009
    Posts:
    96
    This is on Mac Yosemite using Unity 4.5.5f1 (patch 3)

    I have made a small test game where I move a space ship left and right with the following code (In Update() function)

    if(Input.GetAxis("Horizontal") < -0.1f)
    {
    MoveLeft()
    }

    if(Input.GetAxis("Horizontal") > 0.1f)
    {
    MoveRight();
    }

    When I press the left cursor key it starts moving, but if I keep the key pressed and release it as the ship has moved a bit or almost all of the way it can move, the ship will keep on moving for half a second after I have let go of the cursor key. It will not stop instantly as I let go of the cursor key. If I play with a joystick it will stop instantly.

    It's seems like the keyboard input is being buffered and the buffer is slowly emptying it self.

    Is this a bug or a feature of Unity 4.5.5?? It was not like this in earlier versions of unity.
     
  2. Deleted User

    Deleted User

    Guest

    its a feature. You can change this behavior in the Input settings, I think its called dampening or somethink like that or use GetAxisRaw() instead
     
  3. WarbladerToo

    WarbladerToo

    Joined:
    Nov 2, 2009
    Posts:
    96
    Was out of the house and was thinking about this and started to wonder if I had seen this before... And now as you mention this, I have seen this before. :) Starting the get senile....

    Thanks!