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"

Get a variable from another blueprint

I have two BPs, in one of them is a variable I need in the other too, so how do I get the variable in the other BP?

Product Version: UE 4.9
Tags:
more ▼

asked Sep 26 '15 at 07:19 PM in Blueprint Scripting

avatar image

Bluegru
3 2 3 6

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

1 answer: sort voted first

You just need a reference to the other BP, pull out the wire and search for "Get ". If you want to edit it you might have to make the variable editable.

I would highly suggest you watch the tutorials on BluePrints (not the quick shots) on the Epic Games Youtube channel since they explain most of this stuff.

more ▼

answered Sep 26 '15 at 07:37 PM

avatar image

Erasio
5.9k 291 86 293

avatar image Bluegru Sep 26 '15 at 08:09 PM

thx, I'll check out his channel, but how do I get the reference? I tried cast to but that didnt work

avatar image Erasio Sep 26 '15 at 08:21 PM

Casting only checks if the object you are referring to or any of it's parents is the class you are casting to so from then on you can use variables and functions from it.

How you get the variable is depended on your case and preferences.

You can store it in when you spawn it, you can get it via hit or overlap events or by getting all actors of it's type on the map.

There's a lot of ways.

I would honestly recommend to first watch the videos before continuing. BluePrint is a relatively easy way to create functionality but you still need knowledge of programming to use it properly. Specifically you will need to know object oriented programming because that's all games are. Tons of objects interacting with each other.

The videos will get you at least on a basic level so you can do simple things.

(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