using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraOrbitExample : MonoBehaviour { public CameraOrbit cameraOrbit; public Transform[] targets; int idx=0; void Update() { if (Input.GetKeyDown(KeyCode.Space)) { if (idx < targets.Length-1) { idx++; } else { idx = 0; } cameraOrbit.SetTarget(targets[idx]); } } }