- Home /
Can GUI elements retain the ability to change color (via ButtonScripts) when they have no depth?
3DText shaders allow text to be view able through all objects within a scene. Inline with this, I have GUI elements, specifically buttons, which need to be visible through any objects in the scene.
Applying either the GUI/Text or the Unlit/NoDepth shaders to the Material used on the GUI elements produces the desired effect. The GUI elements will now display through objects.
But! (as there always is) ButtonScript color changing features do not work with either of these Shader options (e.g.: Normal, Highlighted, Pressed, Disabled state fields manipulate the color of a button based on how it is interacted with).
The picture below shows how one user, @Eldoir, came up with a solution to retain color for their material using a 3D shader. However, this solution is Text specific as it provides a single color adjustment. ButtonScripts provide an array of color changing options.
tl;dr - How to disable depth on an GUI element (ensuring the element is visible through all objects) and retain its color adjust-ability through ButtonScript states?
[Photo credit: Eldoir]
Note: op formatted using correct spacing, however this does not show in the end result above.
Your answer
Follow this Question
Related Questions
3D Custom Render Texture 0 Answers
Represent Land 3D Area End 0 Answers
Intersection Highlight Shader -1 Answers
3D Text - Stroke/Outline 4 Answers
Need help with URP Lit Shader 1 Answer