- Home /
Question by
Shacki · Dec 11, 2020 at 06:31 PM ·
scripting beginnerinputmanagerkey
Get the key assigned to a button of the Input Manager
I need to print the key assigned to the button "Fire1" for example, in a UI Text. For example: if "A" is for "Fire1" in the UI Text should print "A" and then if the player changes "A" for "B" in the UI Text should print "B"... is it possible?
public GameObject ThisButton;
public string fButton = "Fire2";
void Start()
{
ThisButton.GetComponentInChildren<Text>().text = fButton;
}
In that case the button returns the string "Fire2" instead of the key assigned obviusly. Thanks
Comment