using UnityEngine; public class Ellipse2D : MonoBehaviour { public float speed = 1.5f; public float width = 1.5f; public float height = 1.5f; public bool clockwise = true; Vector2 pos; Vector2 go; void Start() { pos = (Vector2)transform.position; } void FixedUpdate() { go.x = Mathf.Cos(Time.time * speed) * width; go.y = Mathf.Sin(Time.time * speed) * height; if (clockwise == true) { go.x = -go.x; } transform.position = new Vector3(pos.x + go.x, pos.y + go.y, 0f); } }