Input.GetButtonOrigin

static string GetButtonOrigin( string name, bool ignoreController )

Input.GetButtonOrigin

static string GetButtonOrigin( InputAnalog analog )

User Comments

Jul, 7 2022
20
You can use this to get the string value that closest represents the key you have assigned to an action.

Example:
public string interactkey = Input.GetButtonOrigin("use");
//In my case, "use" is assigned to the E key in my game settings. So this sets interactkey to "E".
Jul, 7 2022
20
public string interactkey = Input.GetButtonOrigin("use");

In my case, "use" is assigned to "E". So interactkey is given a string value of "E"