So, i’m a noob, i know, i try my best to learn unrealengine 4, but i have a problem:
Basically, i have a really simple setup, my goal is when my character in a 2D scroller template overlaps a box, there is an event that fires via an interface, and then to a HUD, so a message gets printed on the screen.
Oh right - ok I just did a test on my pc and it looks like ‘target’ variable is empty, or uninitalized. I believe that if the blueprint/class you are trying to reference doesn’t exist/is instanced in the level, then you need to initialize the blueprint type variable in the CONSTRUCTION SCRIPT (the script that is called on game start on the blueprint) and specifically place the blueprint/object you want to use as reference inside the ‘target’ variable before you can use it.
Here’s what I did in my setup (you would do this inside your PlayerGameOver blueprint construction script graph)
To clarify a bit, what I’m calling CamActor Test is the same as your Target variable:
In your 3rd screenshot where you are calling the event and passing in the HUD blueprint variable, that’s not actually calling the event on the HUD that’s in use by the game, that’s just trying to reference the HUD blueprint class in general. If you’ve setup a Game Mode blueprint that uses your custom HUD and set that Game Mode in the level’s Blueprint settings, then in order to call this function to your HUD, you would reference like so:
That actually helps me as well, knowing that this is how you pull the level instance of the game blueprints. Initializing blueprints for reference and game blueprints are very poorly documented in my opinion, I’ve tripped up a lot on these.