Hi good day! I’m having a problem wanting to rotate an Image in the UI that is a circle, the idea is simple that the circle when pressed with the mouse or a touch of the cel you can move it on its own axis following the circular movement of the mouse or finger . But the problem is that when you click on the circle it automatically rotates and then from that given angle it starts spinning based on the mouseposition.
v3Pos = target.position;
v3Pos = Input.mousePosition - v3Pos;
angle = Mathf.Atan2(v3Pos.x, v3Pos.y) * Mathf.Rad2Deg;
transform.rotation = Quaternion.AxisAngle(angle,Vector3.forward);
Thank you very much to anyone for the contribution to advance!