SpawnActor with variables?
I need to Spawn a Actor while also defining the variables so already the construction script does things based on those parameters. How can I do that?
Furthermore I like to just pass all the variable parameters from the parent BP to the spawned Child BP. Basically I have tree branch BP with lots of parameters which can spawn a smaller child branch which should have the same parameter settings.
asked Aug 04 '15 at 12:47 PM in Using UE4
You can set any variable in a BP actor with an "Expose on Spawn" flag (in the details panel when the variable is selected in the BP editor) which will add a pin for a value to pass into it when using the SpawnActorFromClass node. Make sure you set the variable(s) "Editable" as well. The construction script will now have access to that value from the start.
As far as passing variable parameters from parent class to child class, that should already happen automatically as part of normal inheritance. The child will take on the default values of the parent. If they need to be changed in the child (i.e. have some non-default value) you can simply pass that in by making the variable exposed on spawn as above.
answered Aug 04 '15 at 01:29 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here