How to dynamically create a text label positioned in 3d space using C++ ?

Hello,

I’m trying to dynamically create a text-labels with an individual text and position them in 3d-space from a custom C++ Actor-class. Unfortunately every single way I tried either crashes or won’t compile.
Can anyone give me a hint on how that is supposed to work ?

Thanks in advance.

You can use a WidgetComponent to place UMG widgets in world space.

https://docs.unrealengine.com/latest/INT/Engine/Components/Widget/index.html

yes, but every attempt i’ve tried with this crashed and didn’t work. (because of nullptr in WidgetTree members)
does anyone have some actually working sample code for this ?

Is it for debug?
Have you tried DrawDebugString?

If this is supposed to be like a character name over the head of an actor in 3D space maybe try to use a TextRendererComponent. If you want it to always look at the camera you should use billboards. If it is just a 2D HUD text that should appear on the player screen then try using the widgets.

Ah thank you. TextRendererComponent was new to me and at least with that i get some text to render.
What class are you talking about exactly when you say “use billboards” ? Currently I rotate them manually to the camera each frame…