A
A
Alha16902019-01-05 00:11:07
C++ / C#
Alha1690, 2019-01-05 00:11:07

What to use to recognize mouse clicks in Unity?

Since the System.Windows.Forms library is disabled in Unity, then what should be used to recognize mouse clicks / hold downs?
Input.GetMouseButton is not working, because it requires the button to be pressed.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
stictt, 2019-01-05
@Alha1690

Clamping is a click in essence. Pressing the mouse button 1 game tick will be regarded as a click by the system. Input.GetMouseButtonDown(key) when pressed, will process the event 1 time, if my memory serves me right, there will be no repetitions of each game tick.

F
freeExec, 2019-01-05
@freeExec

So use GetButtonDown/GetButtonUp

P
p4p, 2019-01-05
@p4p

Input.GetMouseButtonDown

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question