Search Unity

Gizmo error

Discussion in '5.5 Beta' started by Griffo, Oct 20, 2016.

Thread Status:
Not open for further replies.
  1. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    683
    Hi,

    Is this a bug? I have the below code and every time I move around in the scene view I get the error ArgumentOutOfRangeException: Argument is out of range continuously until I move the pointer out of the scene view .. Didn't seem to have it before ..

    The line is 19

    Unity 5.5.0b7

    Code (JavaScript):
    1. function OnDrawGizmos ()
    2. {
    3.     if(spawnPoints.Count > 0);
    4.     {
    5.         for (var i=1; i < spawnPoints.Count; i++)
    6.         {
    7.             var path = new UnityEngine.AI.NavMeshPath();
    8.             UnityEngine.AI.NavMesh.CalculatePath (spawnPoints[i-1], spawnPoints[i], UnityEngine.AI.NavMesh.AllAreas, path);
    9.      
    10.             Gizmos.color = pathColours[i-1];
    11.             Gizmos.DrawRay (spawnPoints[i-1], (Vector3.up*20));
    12.  
    13.             var offset = 0.2f * Vector3.up;
    14.             for (var ii = 1; ii < path.corners.Length; ii++)
    15.                 Gizmos.DrawLine (path.corners[ii-1] + offset, path.corners[ii] + offset);
    16.         }
    17.         if(spawnPoints.Count > 0);
    18.         {
    19.             Gizmos.color = pathColours[spawnPoints.Count-1];
    20.             Gizmos.DrawRay (spawnPoints[spawnPoints.Count-1], (Vector3.up*20));
    21.         }
    22.     }
    23. }
    EDIT..

    Sorry my fault don't think I should have been using Gizmos, changed to Debug.DrawLine and all working fine now, Mod's please feel free to delete this post if it's not a bug, thanks.
     
    Last edited: Oct 20, 2016
Thread Status:
Not open for further replies.
unityunity