Calling a function from another blueprint

So I have this Gameover blueprint widget. And when they press the “Retry” button (Button_297) I want to call a function in MyCharacter blueprint.

I’ve been trying several different ways but haven’t been able to come up with something that works.

So does anyone have any ideas on how I can call a function in another blueprint?

Thanks!

//Nils Söderman (rymdnisse)

First of all you should do whatever you want to do before you open a new level. Because this is the last thing you will do in this level and in general I work with them as if they were the last thing happening in the script to prevent functions not triggering during the load of the next level.

And now to your question directly.

You will need to reference your “MyCharacter” when opening the BP. If you’re only using single player you could just do “Get Player Character” and leave it at index 0 but you probably not gonna wanna do that. So just add another variable to your widget, make it editable and also enable “Expose on spawn” which will provide you with another pin when you create this widget. Input your character BP there and you should be able to call any function through the reference.

Thank you, also sorry for the super late reply.
I still have some problems though, (sorry for being such a noob).

So this gave me an option to set my variable true or false when I create the widget.

Just to be a bit more clear,

When this button is pressed, I want to respawn the characher, which will be done by setting the wold location for him.
So when the button is pressed I want to run the “Set World Location”.
Also, ignore the “open level” node, it will be removed.

http://i.imgur.com/3t2bKRR.png

http://i.imgur.com/vrwRw35.png

Thanks man! I really appreciate the help! :slight_smile:

Nevermind, I just got it working.
Thank you sooo much! :slight_smile: