'OnClick events starts on leaving the finger
is there a way to trigger onclick events by the on click and not by leaving the finger because the onclick event only triggers when you leave the finger from the button.
Thanks
Solution 1:[1]
You can use the GetMouseButtonDown. https://docs.unity3d.com/ScriptReference/Input.GetMouseButtonDown.html
Or potentially GetMouseButton
https://docs.unity3d.com/ScriptReference/Input.GetMouseButton.html
Depending if you want your event to happen once on pressed or repeatedly while pressed.
Solution 2:[2]
OnClick is triggered on MouseUp after MouseDown on the same object.
You can use PointerDown() that is sent the first time a finger touches the screen or a mouse button is pressed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kpie |
| Solution 2 | Cayman |
