UMG Tutorial bug: Displaying HUD point 4

I couldn’t get it to cast to the type of object i wanted as per the tutorial.

Turns out something has changed since tutorial written.

The variable that you are setting in the MyCharacter blueprint is already of the right type so you dont need to cast it.

When you create the variable in the Widget (the max ammo variable) it is a local variable by default so you cant access it externally. So create that as a proper variable (rather than just dragging backwards in the graph) and then in the MyCharacter blueprint when you get access to the GameHUD as type GameHUD then you can jsut set it directly with no cast.

Hopefully i haven’t broken the spirit of anything by making that variable non local.