//draw curved path positions void DrawCurved() { //set initial LineRenderer size based on spacing int size = Mathf.RoundToInt(1f / spacing) + 1; #if UNITY_5_5_OR_NEWER line.positionCount = size; #else line.SetVertexCount(size); #endif float t = 0f; int i = 0; //loop over positions and set calculated path point while (i < size) { line.SetPosition(i, WaypointManager.GetPoint(points, t)); t += spacing; i++; } }