How to? - Touch to select, drag to move and drag the rotation marker to rotate the object

Hi,

I’m new to coding
Can someone help me with this scenario?

This is basically for mobile devices.(and can work even on desktop for testing).


  • I will be adding any number of objects in the scene.
  • The object has to select when I touch/click on them.(May be i can add some indication when to say that the object is selected(a close button and a rotation marker))
  • I want to move the object in XZ positions when I drag the selected object.
  • And want to drag the rotation marker on the object to rotate it.

I’m stuck in doing this for 2 days. Can anyone help me with some simple code or redirect me to the solution?

Thanks


Unity API

Touch: Unity - Scripting API: Touch

MoveXY : Transform.position += new Vector(x,0,z);

Rotate: Touch the UI and use Touch deltaposition to += rotation. (Transform.Rotate(new Quaternion))