Rotating a dial with touch and/or mouse drag.

I have a round object that I want to rotate in the direction the player drags, like a dial. I’ve tried reading stuff online about how to do it, and nothing seems to work or make sense. I’m very new to all this, though. Can someone help?

The closest I think I got was this:

I don’t get any errors, but the thing doesn’t do anything and I don’t know why. I’m thinking I have to call those Input functions, but I’m not sure how.

Do you want something like this:

Yeah, I think so. I need it to be when the circle is clicked/touched at all, and rotate in the direction the mouse/touch rotates. No limits, can keep turning as long as they’re spinning it around. And the script is on the circle game object.

I got it working, but the rotation happens to quickly. Any idea how to slow it down? I used this guy’s method to make the rotation happen:

The lines calling the rotation is:

newRotation.eulerAngles = new Vector3(0,0,newRotation.eulerAngles.z);
this.transform.rotation = originalRotation * newRotation;

I tried multiplying eulerAngles.z by Time.deltaTime to slow it down, but the result is strange movement. It jumps quickly and then slows and twitches in place.

When I run the script it follows the mouse position exactly. Since the script calculates the angle between the middle of the gameobject and the position of the mouse, you can’t just scale the angle to get something slower. If you want that you need to use a delta value for the angle and scale that (or something similar).