- Home /
Forcing a GameObject to the highest depth (closest to camera)
I am Instantiating my own gizmo Prefab at runtime, when clicking on a GameObject.
I am using the selected objects transform.position and transform.rotation to place the gizmo in the center of the GameObject.
This is at runtime, not in the Editor. So the built in gizmo functions aren't available.
The Problem:
I would like the Gizmo to appear on top of everything else, but maintaining its proper position in relation to the GameObject.
Basically, what the Unity Editor does with its Gizmos.
Is this doable?
Answer by runevision · Apr 09, 2010 at 11:26 AM
See this question:
Hmm - Doesn't seem to work. I also tried adding "Queue"="Overlay+1" The gizmo is still "inside" of the objects.
I know this is an old question, but what was the issue with your shader that you fixed? I've tried changing the renderQueue and just cannot get it to work at all. Is there something else within the shader that is conflicting with or overriding the renderQueue?
Answer by qJake · Apr 09, 2010 at 07:51 AM
I would like the Gizmo to appear on top of everything else, but maintaining its proper position in relation to the GameObject.
I don't understand what you mean by this... you need to be more clear.
Unity treats any gizmos that you draw yourself identically to those it uses internally. Unless you're doing something different (or you want to produce a different result), you shouldn't be having any problems. There's no difference between a gizmo you place, and a gizmo Unity places (by default).
If you don't understand a posted question, consider stating that in a comment, and not as an answer.
I edited my answer to be more clear for future readers. This is at runtime, and the unity gizmo functionality is only available in the editor.
Your answer
Follow this Question
Related Questions
Unity3D scene not rendering objects in Game screen 3 Answers
Rotating GameObject Around Player With "Mouse Y" Position 2 Answers
Set Game Object Position to Sides of a Camera 1 Answer
GameObject is in and out camera FOV 1 Answer
Is there a way to write to Deferred Depth from a command buffer in CameraEvent.AfterImageEffects? 1 Answer