- Home /
Is it possible to have a model only appear in the scene view?
Hi everyone. I have a few specific positions I would like to spawn prefabs at and I would like to be able to see them only in the scene view, just like widgets. If they were models I would also be able to see their orientation and size though. Is this kind of thing possible?
Answer by Bunny83 · May 09, 2013 at 08:31 AM
You can simply put your models on a special layer. Just use the last one (31) and name it "Editor only". On all your cameras you should exclude this layer in the cullingmask.
Since the model is still part of the scene it would bloat up your scene in your final game, so it's better to use a custom inspector for your class.
In the custom editor you would use Resources.LoadAssetAtPath in OnEnable to load a model from an arbitrary folder. This model can be drawn in OnSceneGUI with Graphics.DrawMeshNow.
Keep in mind to only draw stuff in the repaint event. See Event.current.type.
Answer by Graham-Dunnett · May 07, 2013 at 11:01 AM
can you elaborate a bit? I can't see anything in here about 3d models that only appear in the scene view. Does it have something to do with OnSceneGUI ()?
Answer by Captain_Dando · May 09, 2013 at 07:48 AM
Ok, I wasn't able to accomplish what I set out to do, but if it's any help to someone out there, I created my own gizmo icons, which sort of helps.
Create a folder in your assets name "Gizmos" and place the image you'd like to use as your gizmo. then, in the game object you'd like to repesent, place this code:
void OnDrawGizmos() {
Gizmos.DrawIcon(transform.position, "Camera Waypoint.psd");
}
as you can see here, you can use a photoshop file, which is useful if you want to edit it later on, though I've seen people use all kinds of image formats.
This doesn't really sort out my problem with instantly seeing my gameObject's orientation, but it's something.
Your answer
Follow this Question
Related Questions
Available modeling in UNITY 2D 0 Answers
Can model be created in Unity? 1 Answer
Making of mercury,water models in unity 3d? 0 Answers
Turning Models/Meshes into Prefabs 1 Answer
Object is invisible when there is another object behind 1 Answer