Unity UI: How to make an image draw over a 3D object in world space? (Quest Markers)
Hello everyone, I'm effectively trying to create a Quest marker. Currently what I've done is put a Canvas onto a cube in unity, and told the canvas to render in 3D space (world), but It doesn't draw over other 3D objects in the scene.
Does anybody know how I could achieve this?
Thanks - CausticLasagne.
Ok. It works. That's some magic stuff happening there. Thanks to everyone who contributed.
Answer by OncaLupe · Nov 19, 2015 at 07:29 PM
Are you trying to draw the marker over ALL other objects in scene? If that's the case you may have to use 2 cameras with culling masks.
Set the marker to a custom layer (lets say "QuestMarkers")
Disable rendering of that layer on the main camera by removing it from the Culling Mask in the camera's settings
Set the second camera to only render that layer with Culling Mask and set the Clear Flags to Depth Only
Make sure the second camera has a higher Depth than the main (main camera defaults to -1, other cameras default to 0, higher numbers are rendered over lower)
Parent the second camera to the main and reset it's position/rotation
This should cause the quest marker to render on top of all other objects in scene.
Answer by _Game_Dev_Dude_ · Nov 19, 2015 at 03:29 PM
Change the canvas to be a world space canvas.
Yes, I have done this, But as soon as the canvas is added to the Object, it looses it's ability to draw over other objects. \/ This guy below has the idea.
Your answer
![](https://koobas.hobune.stream/wayback/20220612045640im_/https://answers.unity.com/themes/thub/images/avi.jpg)