using UnityEngine; public class TurnAround : MonoBehaviour { // Drag & drop the player in the inspector // public Transform Target; public GameObject Target; public float RotationSpeed = 1; public float CircleRadius = 1; public float ElevationOffset = 0; private Vector3 positionOffset; private float angle; //private Transform TargetT; // Start is called before the first frame update void Start() { //TargetT = Target.transform; } void Update() { positionOffset.Set(Mathf.Cos(angle) * CircleRadius, ElevationOffset, Mathf.Sin(angle) * CircleRadius); transform.position = Target.transform.position + positionOffset; angle += Time.deltaTime * RotationSpeed; } }