I
I
iLoveGam3s2021-08-19 09:34:14
Unity
iLoveGam3s, 2021-08-19 09:34:14

How to make valve scroll mechanics?

I need to make the same mechanics as in this game - https://dropmefiles.com/rO0Oc . How can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twobomb, 2021-08-19
@ILoveMakingGames

The first thing that comes to mind is that we hang a down handler on the object, remember the coordinates of the click. and in the bool we write the labor that we started to turn Next, we hang the handler on move, there we get the angle between the coordinates in which we press and the current coordinates, and this angle is remembered. Then it is compared with the angle in the previous call to move, and if this angle is greater, then we rotate clockwise by an offset equal to the difference of these angles, for example, if it is less, then vice versa ... and by the way, you can add one more bool that when released, the crane begins to smoothly return to its original position, close there...
PS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question