using UnityEngine; public class MovingInCircles : MonoBehaviour { public GameObject pivot; public float speed = 40f; public bool clockwise; public bool oscillate; private float t; private void Start() { } private void Update() { t += Time.deltaTime; if (oscillate) { base.transform.position = new Vector3(base.transform.position.x, base.transform.position.y + Mathf.Sin(t) * 0.015f, base.transform.position.z); } if (!(pivot == null)) { if (clockwise) { base.transform.RotateAround(pivot.transform.position, Vector3.up, speed * Time.deltaTime); } else { base.transform.RotateAround(pivot.transform.position, Vector3.up, (0f - speed) * Time.deltaTime); } } } }