Can’t find a way to fix it. I am drawing a ray/line between nodes. And it works great until I am trying to edit node locations. Every time I update node position a new ray is drawn , but old one stay on the screen.
Looks like Debug.DrawRay doesn’t allow to clear it from the screen.
Sounds like you should be using Gizmos from within OnDrawGizmos rather than Debug.
Also note that neither of these will ever be visible in a built game, so I hope you’re only making debug tools. If you need a line in-game, use LineRenderer.
Hi @StarManta ,
Ok tried gizmos before, but they a bit limited, can be called only from Unity OnDrawDizmos function.
For the lines above I have separate functions… not sure how to transfer all of these into on OnDrawGizmos!?
Ok so OnDrawGizmos works well.
One question though.
Over the course of the game I create lists with positions. First I have one and all gizmos are displayed as soon as I add second element into the list only second element gizmos are displayed. First disappear.
I am using foreach loop inside OnDrawGismos to go through elements of the list with all Vector3 positions.