Can I make a font material for TextRenderComponent that functions like a billboard sprite?

I want some text to be displayed above something. Much like HUD but it technically not on screen. HUD text from the “blueprint hud” example is perfect but it can be seen throgh level geometry (mayne there is some workaround?)

Currently I rotate TextRenderComponent manually within C++ Tick function but it gets scaled by distance to camera like any other object and it also affected by shaders.

So can I make font material for TextRenderComponent
1)always with the same size
2)always facing the camera?
3)not affected by any post-processing?

Can it be achieved at all?

Can it be achieved with only font material? Or I should do something with the TextRenderComponent too?

You could scale text component based on camera distance, you can easily get distance between vector here

With HUD you would need tracing to check if actor is visible for player

Howdy!

Not sure if this is what you are after, but you could add a TextRenderComponent to your Actor like so:

And set up your Blueprint for the Actor like so:

This will get you what you are after for points 1 and 2, as for point 3 about the text being not affected by post-processing, I made a copy of the default text material (located in the Engine folder). I set the Lighting Model to Unlit and added an Emissive Color Value of 1 to make it appear white but unaffected by lights.

Hopefully this will get you started and you can make adjustments as needed.

-W

Hi Wes,
Thank you for your reply. I have another solution for this (through material). I described it in this forum post.

Nice. I set the (X,Y) scaling of the text to N / Pythagoras (Camera Location - Text World Location). It gave me a decent look anywhere I was in the map. Adjust N to your preference: the smaller N is the bigger the ratio. Of course, the further you are the bigger the font seems to be next to a little character, but its the same size whether near or far. Thank you to both answers.

This worked really well for a player number text on top of a player, by simply replacing the Get Player Character with a Reference to the Camera you are using to view the character.

Thanks!

You need to switch font material Blend Mode to Translucent and check Disable Depth Test.
Same size and autofacing is up to you (Set World Size, Set World Rotation).
No postprocessing affecting can be achieved probably by the Depth-Stencil.