- Home /
Question by
aspiranteaprogramador · Jul 08, 2019 at 06:49 PM ·
textkeycode
,How to print on screen the key or button that player have choose
Hi, I've a question about input tab in unity. I want to show ButtonCode that player has choose.
===================== in code, I have it ==============================
if(minimumDistance <= 2)
{
textPickUp.text = ("Press E to pick up the key");
}
if (Input.GetButtonDown("Fire1") && minimumDistance <= 2)
{
//pick up the key
}
======================== but I want to a kind like this ===============
if(minimumDistance <= 2)
{
textPickUp.text = ("Press " + button(Fire1) + " to pick up the key");
}
if (Input.GetButtonDown("Fire1") && minimumDistance <= 2)
{
//pick up the key
}
Please, how do I get it?
Comment
Answer by bgoldbeck · Jul 08, 2019 at 09:35 PM
Let the user decide their controls, then display them the options for pickup.
Your answer
Follow this Question
Related Questions
Assign keystrokes to GUI button 2 Answers
Key down, to edit property 1 Answer
Dynamic KeyCode Unity Exception 2 Answers
Trying to play an animation using the 'E' key. 1 Answer
Open scene by typing a word 1 Answer