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?
//Nils Söderman (rymdnisse)
asked Jan 16 '15 at 02:49 PM in Blueprint Scripting
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.
answered Jan 16 '15 at 02:56 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here