Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Getting Joystick Axis at Start

Discussion in 'Input System' started by DCTShinobi, Jul 11, 2020.

  1. DCTShinobi

    DCTShinobi

    Joined:
    Jun 23, 2014
    Posts:
    51
    Hello! I'm trying to code the input for a joystick throttle, and everything seems to work except this...

    It seems that my throttle axis defaults to 0 whenever I hit Play in the editor. I want Unity to get the current position of the throttle (for example, all the way back, which would be -1) whenever the game starts.

    I've tried to get the correct value of the axis both in the Awake() and the Start() functions, but neither seems to work. Even in FixedUpdate(), nothing changes away from the default 0 until the throttle is actually physically changed (such as to -.9). After that, the throttle input is read accurately.

    I would prefer to get the actual value of the axis at the beginning instead of having it default to 0 (or to some other arbitrary number). Is there any way to do this?

    Thank you! :)