- Home /
Light sensitive text in Unity 4.6
Hi everyone,
I need to create a dynamically changing text that reacts on light sources in the scene. I'm using Unity 4.6.1 and 3D-Text has been removed obviously. The text element from the new UI system doesn't seem to work.
What would you propose?
I'm not sure if it's possible to get dynamic text working with lights in 4.6 UI, but 3D Text does still exist in Unity. It's just not in the menu anymore. You can add it by adding the Text$$anonymous$$esh script to a GameObject.
Answer by rob5300 · Jan 14, 2015 at 06:14 PM
You can change the material that the UI text uses, and you can use a normal shader such as Defuse which will react to lighting. Soo simply create a new Material that uses the Shader you want/textures, and apply it. More info here: http://docs.unity3d.com/Manual/script-Text.html
If you want the text to be in world space, and not just overlay over the camera, make sure to set the canvas that is REQUIRED for any ui objects to world space.
I tried both solutions but neither one works. I created a new material and selected the difuse shader. When I attach this material to the UI text element or the 3D text ins$$anonymous$$d of the default font material then the text disappears. There is a directional light source in my scene which works fine with my other textures.
Answer by khos85 · Jan 14, 2015 at 10:58 PM
Idea: Or point a light at the text and change the colour of the light shining on the text?