T
T
Test2019-03-10 16:57:07
C++ / C#
Test, 2019-03-10 16:57:07

How to get two pressed unity 3d objects?

2d. There are several objects (let there be Rects). When you click (finger / mouse) on 2 objects - they change places.
Trouble is to find these two clicked objects. Through IPointerDownHandler and OnPointerDown on the go is not suitable, because this script is hung on the object itself. As I understand it, you need to hang a touch handler on the mb camera. To find the object of the first touch, then the second and swap them

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mopsicus, 2019-03-11
@mopsicus

You can, when you click / click, throw a raycast and get an object under your mouse.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question