Search Unity

How to access gamepad triggers at runtime

Discussion in 'Scripting' started by VoidFish, Aug 31, 2015.

  1. VoidFish

    VoidFish

    Joined:
    Nov 27, 2012
    Posts:
    31
    I have used the following code very successfully in the editor:

    if (Input.GetAxisRaw("fire1") > 0.0f) {...}

    with the input set as:
    http://i.imgur.com/A9LjeyO.png

    However I was wondering how you access triggers in an actual game build, not just running in the editor/run.

    I'm sure this is a very novice question, so I was also hoping if somebody could direct me to the documentation that explains this behavior. I googled to the best of my ability but couldn't find anything explaining the difference.

    tl;dr triggers work in editor but not in build, why?