How To Call A Function From Level Blueprint To Be Used In Class Blueprint?

I am curious as to how to call a function from level blueprint, in a class blueprint?
Usually I simply use Blueprint Comms… but I cannot make the level blueprint a variable to reference.
I saw the event dispatcher, but not sure if this would work. I was hoping to somehow just call the functions in my level blueprint I already created.

Any advice would be appreciated, thanks

Level bluprint should be some class, try search node that will get level class instance from which you can call funtion

An event dispatcher would be the best way to go. You create the dispatcher in your class blueprint that resides within the level.

6037-addeventdispatch.png

Name it whatever you like… I named mine Say Hi!

First, create an event that will “fire” when you want to call your level function. For me, I just used a component over lap, so when the player walks in to it, it executes on the level.
After that, drag the dispatcher out on to the graph and use the “Call” option.

Now, drop your blueprint in to the level and keep it selected. Open the level blueprint, right click, and start typing the name of your event dispatcher. It should pop up.

Finally, just drag a wire to your function in the level graph.

Thank you for the detailed answer.
What if you were spawning a pickup in the level… and this pickup would not spawn to the level started. Would you simply drop the pickup in order to create an action with that plugin.

My pickups modify the players ammo and health, so I had these pickups “overlap” events happen in MyCharacter.

Would I simply want to make these pickups happen in Level Blueprint (even though they are not in the level until the game starts)?

In this case you will want to be using Blueprint Interfaces. They are a little tricky to understand completely how they work from the start, but basically you can make your “Pickup” blueprint do all the work for you through the interfaces.

Say you have an ammo pickup that gives your character more bullets-- You can have that pickup blueprint transfer the information directly do your character through an interface. In this case, the only thing the level blueprint will be doing is spawning that particular pickup.

Assuming you haven’t used these before –

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/index.html
https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/UsingInterfaces/index.html

Those two are a good start.

If you’d like to see a video, this is a good example of them in use.