Best way for In game nameplate or info box

What would be the best approach to have billboarding 2D info box over characters heads?

Should this be using slate, or an actor in the scene with a dynamic texture?

I’m starting the AI for my game and need to have some visual ques on the screen to help debug the cats states, to start with will just be one float variable that each AI will have and would like to display it like a progress bar.

I don’t want to just write text to the screen, as there are a bunch of cats, and selecting them is not part of the

Any suggestions? Thanks

Hey Mike,

You could use DrawDebugString found in DrawDebugHelpers.

DrawDebugString(const UWorld* InWorld, FVector const& TextLocation, const FString& Text, class AActor* TestBaseActor = NULL, FColor const& TextColor = FColor::White, float Duration = -1.000000);

Or if you want something fancier then in the Blueprint Example content there are commentary boxes that display text in game. You could spawn those over the AI and fill in the text via script.

Thanks, I’m aware of drawing to the screen. That’s not what I’m looking for. The blueprint for those Info Boxes is very involved, and it’s not what I’m looking for.

I was really wondering if Slate can be used for this. The documentation says it’ s easy to use. But, I can’t really tell what it’s supposed to be used for.

I think I’ll try to extract the TextureRender stuff out of the Info Box example BP.

Just so we are clear DrawDebugString does not draw to the screen or HUD. It displays text in a 3D location somewhere in the world. Therefore you could set the text location above the AI heads and update the location in tick. But slate would look much better. Good Luck!

I wasn’t aware that was in the world, thought it was on the view plane. But, I’m looking for more of a graphical solution. Like a health bar.

Hi Michael,

A simple approach would be just drawing directly on the HUD Canvas. Deproject your actors’ positions into 2D and use the canvas drawing tools to draw your bar. Check out AStrategyHUD in the StrategyGame sample for an example.

Cheers!
Jeff

This method looks promising, I’ll check it out next time I get to work on the project.

Hello,

This is a question from the beta version of the engine. We are marking this answered for tracking purposes. If you are experiencing an issue similar to this please post a new question.

Thank you.