Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Get Positive Button (as string) bound to axe of the InputManager

Discussion in 'Scripting' started by Jim_West, Dec 22, 2014.

  1. Jim_West

    Jim_West

    Joined:
    Aug 5, 2013
    Posts:
    49
    Hi,

    is there a way to get the Positive Button a player has bound to a key?
    Theres a way to get it in the editor (SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/InputManager.asset")[0]), but that doesn't work when building the game to an exe file.

    I wanna do something similar to this:



    I need the name of the button, but the API only gives me a bool if its pressed, but not which key it is?