Y
Y
Yura Mailler2021-01-19 09:24:16
Unity
Yura Mailler, 2021-01-19 09:24:16

How to click on an object?

Hello! How to make a click on a 2D object like a button on a phone and a PC?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Bogdan Erolskiy, 2021-01-19
@B-Erolskiy

Implement the iPointerClickHandler interface to this object in the script , and process clicks on this object there.
The second way (if for UI) is the Button component .

D
DANICH70, 2021-01-19
@DANICH70

Of course, I'm not talking about, but try to put the button in the character, and set the transparency to the button.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question