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

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?