x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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? alt text

Thanks!

//Nils Söderman (rymdnisse)

Product Version: Not Selected
Tags:
more ▼

asked Jan 16 '15 at 02:49 PM in Blueprint Scripting

avatar image

Skwarebyte
3 5 4 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jan 16 '15 at 02:56 PM

avatar image

Erasio
5.9k 291 86 293

avatar image Skwarebyte Jan 26 '15 at 10:15 AM

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.alt text alt text

Thanks man! I really appreciate the help! :)

avatar image Skwarebyte Jan 26 '15 at 10:23 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question