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"

Set/Get Child Actor Variable(s) inside function

I'm wondering if it exist any way to set or get Variable from a Child Actor inside the construction script or Functions in a blueprint, and if not can it be a new feature in next versions ?

Actually you can only set child actor variable on the Details tab of the component, here is an example of one child actor with 2 Variables, Variable 01 a Float and Variabe 02 a Boolean : alt text


Here is some "fakes" of what I would like to do :

alt text

Or like in this way :

alt text

Good idea ? Tell me ;)

Product Version: UE 4.16
Tags:
screen01.jpg (28.0 kB)
fake01.jpg (120.9 kB)
fake02.jpg (133.1 kB)
more ▼

asked Jun 03 '17 at 12:44 PM in Blueprint Scripting

avatar image

IBREC
51 2 5 6

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

1 answer: sort voted first

You have to use the nodes GetChildActor and then cast it to the correct actor. Then it works.

HTH

more ▼

answered Jun 03 '17 at 12:47 PM

avatar image

NoobsDeSroobs
2.7k 106 35 180

avatar image IBREC Jun 03 '17 at 01:05 PM

Yes I know, it works on functions like BeginPlay or anything, but it doesn't work on the construction script.

An example : My child actor is a lamp, on his own construction script I put a boolean, when it's true : the light turn ON.

But if I set this boolean "true" on an other construction script inside an other blueprint, through a childactor with a Cast, it doesn't work.

avatar image IBREC Jun 03 '17 at 01:13 PM

The construction script of my childactor : alt text

The construction script of the main blueprint : alt text

Like that, the lamp (ChildActor) won't turn ON

avatar image NoobsDeSroobs Jun 03 '17 at 01:16 PM

You never call the super construction script so it is never executed. Call the super construct function.

avatar image IBREC Jun 03 '17 at 01:17 PM

How to do that ?

avatar image NoobsDeSroobs Jun 03 '17 at 01:28 PM

Right click on the construction script node and select add call to parent script or something similar.

avatar image IBREC Jun 03 '17 at 01:40 PM

Ok I've created it, but I don't know how to use it x)

avatar image IBREC Jun 20 '17 at 01:05 PM

up please ?

(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