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"

Saving variables in a seperate BP

Hey, I'm trying to save variables in a separate BP. My aim is to have a bool in one BP and then use it in the level BP to determine whether I have picked up a sword. My issue is that I can't seem to do this is there something I'm missing?

the separate BP is so I can save the variables so I thought if I stick all the variables in one BP then it would make it easier and would only have to call it once per save.

I'm very new to this so it's 900% my bad haha :)

alt text

Product Version: UE 4.10
Tags:
untitled.png (288.5 kB)
more ▼

asked Feb 28 '16 at 05:06 PM in Blueprint Scripting

avatar image

ojl10
1 1 1

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

2 answers: sort voted first

In order to call functions or access variables of an Actor or Object you will need to have a reference to it. There are multiple ways to do this and the correct one will depend on your specific scenario.

For example, if you want to access your character you could use node GetPlayerCharacter; if it's something present in your level before you start play (i.e. you're not spawning it a runtime) you can select that Actor then right click on the graph in you Level Blueprint and choose Create a reference to XXXX

For more information about Blueprint communication I strongly recommend watching this tutorial:

Training Stream Training Blueprint Communications with Zak Parrish

more ▼

answered Feb 28 '16 at 05:32 PM

avatar image

phoboz
1k 38 13 61

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

Hi ojl10, if i am understanding correctly, and the character is picking up a sword which activates a bool, then this is my suggestions:

Put the bool in the character Blueprint, and have it saved there. Generally I have all of my variables saved where they are targeted for the easiest use of them, so I don't have to use as many casts. So when the character picks up the sword, it will set that bool to true.

more ▼

answered Feb 28 '16 at 05:44 PM

avatar image

JTrocks55
70 6 11 17

(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