Movement system on phones

Hello everybody! I do want to know how to create movement system as in this (for example) game

Is it easy way in unity to create draggable (as on video) button (or any another component, no matter).
Sorry if my question already has answer on forum, but really i don’t know how to search it (what’s name of this movement system is).

This might get you in the right direction. I have implemented the exact same system like D.H. in another game and a home brew gl engine, so i cannot post you any code that just makes sense - but the principle is the same.

  1. You can detect the position of the finger by using Input.mousePosition then you save that and every frame oyu check the diffirence and if the finger is still down on the screen. That will give you some code to detect dragging and touch up and touch down.

  2. In a update function check that the drag start of the touches is hitting a piece of UI geometry by converting the UI corners to a Rect in screen space and then asking the the “touch down position” is within the Rect.

  3. Move the UI object with the dragging value as long as dragging until it reaches a limit of “stretch” from the origin position. When the user releases the finger you need to lerp back to that origin.

  4. detect the rotation from the origin position of the ui element in degrees - this represents the position you want to move in when youare dragging.

  5. make a chacater controller that will move in the direction of your “joystick”.

Thanks for reply, crispybeans. I will use your advices. Actually, I’ve already started to create smth like you described. It would be very interesting for me to see the result of your system. Maybe you can write the name of that game?