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"

Construction script communicate with child actor componant

Hi All, I have a blueprint that is creating a spline road from the spline tut on the ue4 launcher in which I have changed to have street lights which are added in a function in the construction script using the add child component which works fine. the street light bp allows me to turn the lights on and off in its construction script how can i pass the the var true or false from my track generator to the street light?

alt text

alt text

Want i want to do is pass the light switch true /flase from track gen construction script to the added child components construction script is this possible and how would i achieve this pls any help as always appreciated

Cheers Dav

Product Version: Not Selected
Tags:
track-gen.jpg (65.2 kB)
lightswitch.jpg (61.2 kB)
more ▼

asked Dec 29 '14 at 12:33 PM in Blueprint Scripting

avatar image

thedavross
26 5 8 14

avatar image Erasio Dec 29 '14 at 02:44 PM

Usually setting a variable to "Editable" and then "Expose on spawn" (two check boxes in the details of the variable) it will add a pin when you create this actor. However I'm not sure if this works with "Add child". It should in theory but I never tried it.

I hope this helps

Cheers

avatar image Raikoh Jan 08 '15 at 11:44 AM

Unfortunately it doesn't, AddComponent nodes are really weird, it's not possible to add any input nodes to them.

avatar image thedavross Dec 29 '14 at 03:46 PM

thx for your reply but iv tried cast to and creating a var light bp and allowing editable and expose iv even had a go at an interface which i may have done wrong but im not gettin anything.. hmmm is it possible for construction script to communicate with another bps construction script?

avatar image rYuxq Apr 08 '16 at 01:27 PM

Did you find a solution for this? Im stuck on exactly the same. I have an actor, which has child actors of a different actor. The latter has its own construction script and variables for its construction are set during the construction script of the former actor. When I run the construction script of the former actor, the child actors construction scripts gets not run when I set any of its parameters... :/ When I compile the blueprint for the child actors, their construction scripts get run, but as soon as I change the parent actor, every change vanishes :/

avatar image rYuxq Apr 11 '16 at 07:29 AM

Never mind, I solved it :)

avatar image mehblahwhatever Jun 17 '16 at 12:41 PM

Could you please expand on how you solved it?

avatar image rYuxq Jun 17 '16 at 04:25 PM

Yes of course! I wrote a small static library function, which takes an actor and calls "RerunConstructionScripts" on it. When I need to run the construction script of a child actor after I have passed/set its arguments, I simply create it as above, change its public variables and then run that static library function on it. I can post a complete answer later, if you wish

avatar image Cloudy McStrife Jun 17 '16 at 12:49 PM

Hey thedavross Just a tip: Instead of using a branch node in the construction script above. you could just use: SetVisibility with your "Light Switch" Variable as an Input to "New Visibility" ;)

Good Luck :)

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

2 answers: sort voted first

You can get the actor from the return value from add child actor component and cast it to your Actor Class. From this point onwards you can use every public variable provided by this class

more ▼

answered Jun 17 '16 at 12:46 PM

avatar image

Cloudy McStrife
465 13 15 38

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

Here is how I switched a child actor during construction, it may be what you're looking for and it works

more ▼

answered Sep 28 '16 at 09:25 PM

avatar image

JKDev
31 3 6 8

(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