Why is my node value X=0, Y=0, Z=0 when the Location variable passed is a valid 3D world-space location?

I’m having a Class Blueprint (“Barrel”) call a function from my HUD Class when the Barrel is damaged.

The HUD function that is being called:

The relevant Class Blueprint part that is calling the HUD function:

The Problem: The Project node is returning a value of X=0, Y=0, Z=0 even though the Location variable I passed in is a valid 3D world-space location.

Thoughts on resolving this?

The Project node is working fine in another function I have in my HUD, but the difference is that it is called directly from the Event Graph. This non-functional Project node is never called by the Event Graph, but only called by the Class Blueprint (“Barrel”).

Maybe this has something to do with it?

Okay, I’m getting a helpful warning in the console:

PIE:Warning: Warning pzHUD_C_4 Canvas Draw functions may only be called during the handling of the DrawHUD event

I’m still interested in a solution that involves the HUD (I think performance would be better), but I’ve worked out an alternative that involves spawning a blueprint per damage number.

This function inside my destructible blueprint spawns the DamageText blueprint

The components of my DamageText blueprint: I set the rotation of the text to match the camera angle.

The event graph for my DamageText blueprint: this controls where the DamageText spawns and how it despawns.

The in-game result: Don’t mind the clipping, I haven’t gotten around to improving the fade out animation yet.

Try this, i got my HUD working with this method.

The first commented section must be wired in a BP with HUD.h as parent.
The second one you have to put it in your class BP where you want to tell the damage to show, but it must be executed at least once before you want to show the damage or else it will give you a null variable error.
The third section is all you need to do to show the damage in screen, just replace the random float with your damage data.

Oh and remember to set the used variables to “editable”, so its value can be changed for outside his BP.
Hope it works for you! ^^