Good day,I have a problem, my polyline does not start from first waypoint,but it seems to start from te parent. You can see the attached image
thi is my Script for drow :
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(AIWaypointNetwok))]
public class AIWaypointNetworkEditor : Editor {
void OnSceneGUI()
{
AIWaypointNetwok network = (AIWaypointNetwok)target;
// I put name to waypoints
for (int i = 0; i < network.Waypoints.Count; i++)
{
if(network.Waypoints[i] != null)
Handles.Label(network.Waypoints[i].position, "Waypoint " + i.ToString());
}
//Draw Poliline
Vector3[] linePoints = new Vector3[network.Waypoints.Count + 1];
for (int i = 0; i <= network.Waypoints.Count; i++)
{
int index = i != network.Waypoints.Count ? i : 0;
if (network.Waypoints[index] != null)
{
linePoints[i] = network.Waypoints[index].position;
}
Handles.color = Color.cyan;
Handles.DrawPolyLine(linePoints);
}
}
}
this is AIWaypointNetwok:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class AIWaypointNetwok : MonoBehaviour {
public List<Transform> Waypoints = new List<Transform>();
}



