Question by
BestSasamo · May 19, 2018 at 02:57 PM ·
inputaxiskeycodekeyboard inputaxes
Identify custom user input
Hello everyone, I writing a game that will suggest you wich key to press in a specific moment, I created a list of sprites calling them: A.png, B.png, C.png..
Now I want display them when it's the moment, I have the system, but I can't find anywhere how can I check if player changed Axis buttons.
For example:
The standard key for an action is "S" when the player colliding with a specific collider the code called is:
playerObj.transform.GetChild(0).GetComponent<SpriteRenderer>().sprite = Resources.Load<Sprite>("Sprites/Keys/S")
But an user could change the buttons from Unity launcher (where you could set graphics and inputs), than I need something like:
playerObj.transform.GetChild(0).GetComponent<SpriteRenderer>().sprite = Resources.Load<Sprite>("Sprites/Keys/" + Input.GetAxis("Horizontal").negativeButton
Of course that code doesn't exist
Comment