EdBennett
(EdBennett)
April 6, 2020, 8:40am
1
Hi I’m stuck on something that I though would be quite simple.
From a Pawn blueprint I would like to call a function in the level blueprint, but I’m stuck I can’t figure out how.
Usually I would try and call a reference however all the references seem to be to streamed levels.
Thanks
Ed
liam.vd
(liam.vd)
April 6, 2020, 9:16am
2
Good morning,
It would be easier to explain what you want to do once your Pawn is called. You can always use a trigger and set your pawn to “actor” in a “BeginOverlap”. If you can’t use a trigger or it doesn’t fit your function. You can use an EventDispatcher in your character’s BP and call it in your Pawn and the level BP.
1 Like
Generally speaking, the level BP is difficult to talk to / from.
In the level BP you could bind to an event in your other BP, trigger it that way…
EDIT, in fact, scratch that also. It’s better not to try and do it.
What are you trying to do?
FSapio
(FSapio)
April 6, 2020, 9:26am
4
Usually, it is not good practice using the Level Blueprints (unless it’s for prototyping), and there is always a way to avoid them all together.
However, if you really want to call a function in the Level Blueprint from another actor, my suggestion is to use [event dispatchers][1].
In your case, start by creating a new dispatcher on your Pawn (in this example it is called MyPawn):
Then, when you need to call the function on your level blueprint, you just need to call the dispatcher (always on the pawn), like this:
Finally, in your level blueprint you need to “bind ” your event dispatcher, like in the picture below:
Hope this helps.
2 Likes
name-1001
(name-1001)
September 14, 2023, 5:06am
5
Can it be implemented with an interface?