- Home /
How do I show a model to represent a gameObject in the editor view?
Howdy,
I'm interested in showing a model to represent a gameObject that has no visual in game. This is similar to the spawn icon that you can drag around in the Halo series' Forge editor. You can see a 3d model representing the spawn point, but it won't show up when you play the game.
Take a look at the Gizmo class. Quoting from the reference: "Gizmos are used to give visual debugging or setup aids in the scene view."
Answer by Lethil · Feb 15, 2013 at 05:53 AM
It looks like robertbu's suggestion about the gizmos class did the trick. I was able to use it to get the UI item I wanted.
Thanks!
Answer by MarkFinn · Feb 15, 2013 at 05:39 AM
A somewhat crude hack for this is to child any visual object you want to use to the invisible game object and have the main object check for it and destroy it in the Start() method.
We did something similar for level editing.
Actually, as I recall we had a set of "Flag" objects we childed to invisibles, and had a standard script for such flags that did the "Suicide on Start()" thing.