How can I get a GUI button to Invoke Unity Events from my player action map?
I had an on-screen button that rotated my game board 180° (and buttons to rotate incrementally as well) using the new input system but I lost all my code.
After recreating the rest of what I had of my game I cannot figure out how I bound my GUI buttons to my player's key presses.
I've added an "On-Screen Button" and linked it to the "E" key, which is mapped to an action called FlipBoard in my Action Map. When I use the keyboard by pressing "E" it works fine, but clicking on on-screen button with the mouse doesn't work, even though the colors change properly when pressed.
Is there another way to link a GUI button to a key press or a Unity Event defined in the Player script (shown below)?
public void OnFlipBoard(InputAction.CallbackContext _0)
{
FlipBoard();
}
Thanks in advance.
Your answer
Follow this Question
Related Questions
How to differ between a mousedown over the map and a click on a GUI-Button 1 Answer
FormatException: Input string was not in the correct format System 0 Answers
New input system, problem with rebinding 1 Answer
KeyboardState for XRController 1 Answer
How do I specify the gamepad device I want to use in the new input system? 0 Answers