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"

Can't use class as component? (Passing variables to components.)

So, as a short introduction, I started learning UE4 maybe a week ago with a background in C++, UE2.5, and various other shizz such as GameMaker and XNA.

I started out following some of the tutorials on their YT channel, and I decided I wanted to try to create something of my own, so I set to creating a very basic random level generator. The basic way I'm setting it up (which I'm sure is probably a horrible way to do it, but it's basically just for practice anyways,) is by having a MasterPlacement BP which holds some variables for generation, a Placement BP, which is what actually creates the "rooms", and a Room BP, which has derived BPs that contains the objects comprising the physical rooms as well as Placement's for any exits to the Room.

The problem is, I need to be able to access variables that are stored in the MasterPlacement from each Placement, and I can't figure out a good way to do it. What I'm currently trying to do is pass a reference to the MasterPlacement to every Placement created, but I can't figure out a way to pass a variable to every Placement in a Room so that I can pass the variable.

The way I was trying to do this was by using a "Get Components by Class" action to get a reference to all of the Placements, however, I'm unable to do this, as it is saying that my Placement is incompatible with Actor Component Class.

TL:DR; I'm trying to figure out a way to pass a variable to all of the instances of one class contained in a BP, without having to manually create a reference to every one of those instances.

Sorry about the long backstory. I probably didn't paint the most vivid picture of what my problem actually is, so any questions are welcome, but I really don't know what information is useful as I'm relatively new to BPs.

Any help is appreciated! Thanks for reading!

Product Version: UE 4.10
Tags:
more ▼

asked Jan 26 '16 at 09:19 PM in Blueprint Scripting

avatar image

Kewfest
26 1 2 1

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

0 answers: sort voted first
Be the first one to answer this question
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