- Home /
GUIText disappearing after Graphics.Blit call
I currently have a simple Gui text GameObject in my scene. I use it to make a basic GUI.
If I render my scene normally, I will see my gui text normally, as expected. If I use the OnRenderImage function in a script attached to the camera, my GuiText will not show in those frames.
My OnRenderImage function looks similar to this :
void OnRenderImage(RenderTexture src, RenderTexture dest)
{
Graphics.Blit(src, dest, mat);
}
where my material is a simple material using a Unlit/Transparent shader
I have the same question: I needed custom effect, thus I decided to use OnRenderImage callback, but I was surprised that all UI Buttons have gone. Is it a Unity bug, or am I doing something wrong?
Answer by AMU4u · Mar 04, 2017 at 07:02 PM
Does it fire? Throw a Debug.Log("pewm pewm"); in there, see if it runs it.
Rule of thumb for the new GUI elements, trust your code, not your eyes. Make it work, then test in your build. Only way to know if it currently is working properly.