Fade in / out on text render

Is it possible to make text fade in when you move towards it and to fade out when moving away from it?

anyone ?

You can override the material of of a text renderer. Additionally there already is a DefaultTextMaterialTranslucent. Make a copy of this material and multiply the opacity with distance and you have fading text.

in material editor i can not get my distance. Any other way ?

The PixelDepth node will give you the distance you are looking for.

You don’t need to get the distance in the material editor. Just create a float variable named “Distance” and connect it to the opacity pin. Don’t forget to convert it to a parameter. Switch to your blueprint, create a variable with the type DynamicMaterialInstance by setting its parent to your text material. Then update it in the event tick by getting the DynamicMaterialInstance, dragging out a set parameter value node. Calculate the camera distance hen use this value to set the opacity parameter. Don’t forget to apply this material to your text render component.

That is certainly also possible, but performance-wise it’s cheaper to just sample the depth in the material as a blueprint tick function will add some unnecessary CPU overhead.

Opacity isn’t being changed by the color when I’m using that material. How else am I supposed to change the opacity?

WTF? How should that work. I just want the text to have 0.5 alpha, but that is just not possible :frowning: