How do I share a float variable from an Actor blueprint, to my HUD blueprint?

I am working on a physics based game where you toss things into cups, I am doing this with an actor blueprint, that applies velocity based on how long you hold down a button, to another actor blueprint that gets spawned as you release the button. I have the HUD element set up as I think it should be, but when I cast to the blue print of my actor that launches the projectiles, I get an error, and can’t get any info from the variable that I want. The variable is set to public, and I have attached screen shots of the error I get, and the part of my launcher blue print that generates the velocity to apply. Any help would be greatly appreciated, I feel like i’m just missing some dumb thing.

I See a simple beginner mistake so I refer you to this Training Video that covers everything about BP Communication. If you still have trouble after watching the Video (in full please, its worth it) report back and I give you a direct Answer.

Good Luck and Happy coding =)

I figured I may have to give that video a watch. I will hopefully report back in 2-3 hours that I have figured it out, and did a lot of learning.

You mean like global Variables? There are some classes you could consider Global (easy to reach from anywhere) like GameInstance, GameMode, PlayerControllers, GameState, etc. but usually you dont want to stuff everything in there because you can :stuck_out_tongue_winking_eye:

Important is simple to understand that getting a Refference is the most important Part and where you store it or send it along to another Blueprint. You should also keep in mind that you can jump over more than one refference to get what you want. Something like GetUniverse->FindSolarSystem->FindPlanet->GetHabitability

Thats something the Developer is responsible for. You set things up and access the way that makes sense for you. Rarely you need something global.

The way the different classes work is still a bit confusing to me, I’m going to need to watch some more videos on those. It seems like for now, adding functions to my Game Mode BP, is going to be the easiest way to share the kind of info I need, but I’m sure as I learn more I will be able to more intuitively be able to have things in the right class. I’m already shocked as to how easy it is to get into Unreal Engine, I’m a complete beginner and in a month or two I should have a game made. Thank you for your assistance, and if you know of any other good tutorials for a beginner, let me know, I’m definitely going to check out some more of the Unreal Live training ones!

Cheers and thank you again!

So I watched the video, a lot of it was over my head, and I still couldn’t figure it out, ended up looking at the scoring mechanic that I built (from a tutorial) and reverse engineered that, added a function to my game mode blueprint, and was then able to properly cast the float value to my HUD that I wanted to. Thank you.
Follow up question that you may or may not know the answer too, wouldn’t it be easier for Unreal to have some sort of universal variable, that could be easily accessed by any blueprint? I’m a few weeks in to game development, so I’m sure there’s a reason it is done this way, and not with some sort of universal variables, and I guess I’m just curious as to why that is.