How to transfer data like character speed from my character blueprint into a HUD Widget to display it?

I am looking to create a “Debug Draw / Debug HUD“ for my prototype. Basically a list of text in the corner of the screen that displays current stats like character speed, the current movement mode of the character, the game’s FPS, and other game data.

Here’s an image of what I am looking to accomplish:

Right now, I was able to create a Widget that can display the current FPS of my game in a text box. I am trying to also print out my character’s speed and my character’s current movement state in two text boxes above the FPS text box, but I am not sure how to get that info from my character blueprint into this widget blueprint.

Here is what the node graph for the HUD widget currently looks like, if that helps.

don’t add a delay in a tick. it’s superfluous. it will still tick every frame. but it will introduce problems.

use “tickinterval” on the bp.

as for your question, i would have an actor that does all that. so that i can remove it later (on shipping) i’ll call it debug manager or smth.

and manages the ui widget.

then on tick it tries to poll the corresponding objects.

probably on begin play you will get a reference to them, or you can use a softobjectpointer, which will update the reference when the other object (eg teh pawn) is loaded.

i will make it a rule to pull the data from the other objects, and not have the objects push the data to the manager actor. so that it can be removed and it doesn’t affect performance much once it’s removed.

if you need private data from the pawn, then add a function on the pawn like “GetCurrentVelocity”, so that way it’s only called when the manager is active.

that will allow you to also activate/deactivate the debug manager during runtime, potentially by spawning/destroying it. or changing the tick enabled.