var inputfield : Canvas;
function Update() {
if(Input.GetButtonDown("Console")) {
Debug.Log("Button Down");
//inputfield.enabled = !inputfield.enabled;
}
}
Don’t show in console “Button down”, when i press a “Console” button.
But with GetButton it’s working perfectly.
4 Answers
4
Wow. Problem is solved. Thanks everyone.
I think problem was type of a button. It was Joystick axis. When i change type to “Key or Mouse Button” it’s working perfectly
I have this exact issue (with getmousebuttonup(1)). Mines due to another code which uses the same function. Try checking other codes of yours which use the same function by disabling them, then pressing the “Console” button.
You may be able to find out which code is responsible for this issue (if it is the same problem as mine).
did you try all the standard methods like restarting unity or your pc?
also, you can try to change your keyboard
If it’s keys on keyboard use, GetKeyDown. I think GetButtonDown is for mouse and joysticks.
Is this a physical keyboard button? If I recall correctly, there are some types of input devices that do not fire "ButtonDown" and "ButtonUp" events.
– selenir> Is this a physical keyboard button? Yep.
– Sam_SharpshooterSo, a couple of stupid "is it turned on" type questions. 1) Is this script extending MonoBehaviour? 2) Is this script attached to an active GameObject that exists in your scene? 3) Is "Console" defined in your input manager, with the appropriate Positive Button entered?
– kingcoyote> 1) Is this script extending MonoBehaviour? Yes. >2) Is this script attached to an active GameObject that exists in your scene? Yes. >3) Is "Console" defined in your input manager, with the appropriate Positive Button entered? And yes.
– Sam_SharpshooterIf you put a Debug.Log("in update") outside of the if statement, do you see that show up in your debug log?
– kingcoyote