When I press the “Play” button in the Sceneviewer I can see this red line very shortly and then it disappears. I don’t think this should happen… any help?
do you have the call in update? cause at the start of the new frame such immediate mode stuff “xxx.DrawXXX” will be gone again, you need to redraw them each frame
do you have some condition you check on if you want to draw it or not and are both objects in view?
And also are you checking it in the editor view instead of the game view?
Unfortunately “yes” to all. I see them both very good. And I use the Scene view, not the Game view.
The scene is really simple. 1 Plane and 2 cubes on it. There is absolutely no other code attached than this:
For verifying purpose I just started a completely new Project with absolutely no imports at all, and really only 2 static cubes. Again the same issue… I also tried to attach this script to an “empty” gameobject and not one of the cubes directly. The same issue.
Ooops, obviously I have confused myself. Whenever I pressed play it automatically switched to Game-View. I didn’t realize that, thought it was still Editor-View. After switching back I’ve seen it works. The error was sitting in front of the computer I guess…