Mouse button hold only fires once
Using Input preview-0.2.6
My event handler for the mouse button hold is only firing once when clicked. Isn't the goal of hold to keep triggering the event handler until the mouse button is released?
Tick the "Continuous" checkbox to get this kind of behavior.
Think we need to improve the UI/wording/presentation here to make this clearer.
By default, actions react purely to input. So if there's no input, there's no actions. If you want actions to keep triggering even if there's no input, "Continuous" mode is meant to cover that.
Isn't the goal of hold to keep triggering the event handler until the mouse button is released?
You're talking about the "Hold" interaction, right? Probably also something that we can improve in presentation to make the workings clearer. What "Hold" does is require the control to be held for a specific, minimum duration before the action triggers. Think weapon charge. Or "A" button confirmation that requires you to hold the button down for a bit before the "confirm" action triggers. That kind of stuff is the domain of "Hold".
Ahhh. I thought "hold" meant the user was holding the button down. If your reword the UI, might I also suggest something to indicate if continuous, how long to wait between each call back to the event? For example, x time the user has to hold down the button to trigger it and y time between each call to the handler?
BTW, I was trying to use the mouse hold to raise/lower the terrain in run time for my use case. The longer it was held, the taller/shorter the terrain under the mouse rayhit got.
Thanks for the help above!
If using Continuous, the input action will be triggered every update. In your case, you want to try Hold + Continuous, and setup a timer in the script. Or you can use an Interactions that give you a clear start and end mark, pair it with a bool, and execute in Update. I recommend forum to find help from the community: https://forum.unity.com/forums/new-input-system.103/