How do you move a sprite along known circle?

I’m basically trying to increment the point out from the center by incrementing the angle in steps. This certainly isn’t right though.

 private Vector3 pos;
     private float radius;
     private float angle;
     private float speed;
     private Vector3 centerPos;
     private Vector3 nextPoint;
     public float angularSpeed;
 
     // Use this for initialization
     void Start () {
 
         pos = transform.position;
         centerPos = transform.position;
         angle =  1.0f;
         radius = 8.0f;
         angularSpeed = 7.0f;
 
     }
     
     // Update is called once per frame
     void Update () {
 
         angle = (angle + 1 * Time.deltaTime) % 360;
 
         float x = centerPos.x + (radius * Mathf.Cos(angle * Mathf.Deg2Rad));
         float y =  centerPos.y + (radius * Mathf.Sin(angle * Mathf.Deg2Rad));
 
         transform.position = new Vector3 (x, y, 0.0f) * radius * Time.deltaTime * angularSpeed; 
 
     }

How can I rotate around this path? I’d like to learn this method, because I want to be able to control when the rotation stops at desired angles.

Alright a couple of things:

  1. Mathf.Cos and Mathf.Sin receive radians. So I would multiply the angle by Mathf.deg2rad

    float x = centerPos.x + (radius * Mathf.Cos(angle * Mathf.deg2rad));
    float y = centerPos.y + (radius * Mathf.Sin(angle * Mathf.deg2rad));

  2. I would also add another multiplication in the angle += 1; the update method is being called many times per second so you are adding anywhere from 60 or more degrees per second. To fix it you need to multiply it by Time.deltatime. That will then set it so it goes 1 degree per second and I would add a modular function just in case you go over 360 but that’s just in case you go over the float limit which I don’t think you would in a looong time.

    angle = (angle + 1 * Time.deltatime) % 360;

  3. I would create a new variable called angularSpeed and then replace the ‘1’ so you can modify the speed in the editor.

Hope that helps!