A
A
Artem Kravchenko2020-08-30 17:42:13
C++ / C#
Artem Kravchenko, 2020-08-30 17:42:13

Unity swipe movement code, how to fix?

5f4bba0644445333372999.png5f4bba11a7adb989662312.png

Hello. I have the code that is in the picture. Unfortunately, I don't really understand how it works. I want the sphere (on map 2) to move in the direction of the swipe. But it moves exclusively to the left and right. How to make it move in the direction of the swipe? Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-08-30
@firedragon

After positionChange.y add positionChange.x It is possible that z in general, try all the options, I don’t know Unity, so don’t kick me if I made a mistake,
I added what needs to be inserted

positionChange.y = -positionChange.y;
positionChange.x = -positionChange.x;
//возможно что не понадобится
positionChange.z = -positionChange.z;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question