Just like in the title. Unfortunately Child Actor Components don’t have constructor variables inputs like Spawn Actor from Class when ‘Expose on Spawn’ is selected. Is there any workarounds to pass variables to child actor component before construction script executes?
Spawn it as an actor then attach it as a child?
In my case child actors need to be set up already in Construction Script, before BeginPlay - so spawning is not an option unfortunately. Well, I’ll try to rebuild my system somehow to work around this.
Constructor script is quite limited in unreal, Epic should really rewrite whole construction code, it is great idea but falls short, almost unusable for procedural maps.
What you are facing is problem of constructor script, it cannot interact with any other actors by design, because it is not guaranteed that those actors exist at all during execution of construction script.
There are multiple problems with construction scripts when you extend them beyond simple in editor customization.
If you ever plan to make multiplayer for your game, either drop whole procedurally generated in construction script idea, or start moving into multiplayer now.
You may finds workarounds, but it is like kicking contest with horse, some stuff may work some other will get broken. For eg i found workaround to similar problem you have, but then for some reason random integer from stream stopped working.
That whole procedurally generated stuff should be done from C++. You create that map there then spawn all actors, that may be blueprints. Look at dungeon architect, it has source code provided, so you can see it and create your own.
PS. i had quite nice labirynth generation blueprint but I could not do it working in just construction script. It needed to spawn other actors, for eg wall actors that can be randomized, or changed after spawning. So it was done either in begin play, so during gamepaly and dynamically, or in construction but then just static meshes, no actors with some logic, like doors.