using UnityEngine; public class EnemyPath : MonoBehaviour { public Transform[] waypoints; private void OnDrawGizmos() { if (waypoints == null || waypoints.Length == 0) return; Gizmos.color = Color.red; for (int x = 0; x < waypoints.Length; x++) { //if (waypoints[x] != null && waypoints[x] != null) { Gizmos.DrawWireSphere(waypoints[x].position, 0.5f); if(x < waypoints.Length - 1) { Gizmos.DrawLine(waypoints[x].position, waypoints[x + 1].position); } } } } }