- Home /
How do you place a GameObject in front of a ui?
I've been having a hard time finding anyone else that has done this in the newer versions of Unity. Everything I can find uses the GUI Layer which has since been made a Legacy element so I don't want to rely on it. Any help on how to make a GameObject appear in front of a UI would be great, thanks!
Answer by hectorux · Jun 23, 2018 at 11:24 AM
There are several ways: -1st is to make a camera with a render texture. Then, you have a raw image in your Canvas. This will set on your canvas all that your camera is renderign so you should use layers to just render the object.(Best) -2nd you can make your canvas to screen space in canvas, and put an object child in front of it.
Yeah I just realized "Screen Space - Camera" is a render mode. I would definitely recommend just using this if anybody ever comes across this post.
Would not recommend doing this as your UI elements are a lot harder to scale based on aspect ratio.
Your answer
Follow this Question
Related Questions
How do I arrange a stack of GUI elements? 2 Answers
GUI behind a 3D model 3 Answers
Show GUI above Gizmos 0 Answers
gui or 3d model for hud ? 1 Answer
Delay in displaying message on screen 0 Answers