Wrong child actor components reference when spawning from construction script
I have a blueprint BP_Map that depending on public size variable spawns a number of child actors BP_Region that are placed in a rectangular grid. For each BP_Region to be spawned I am creating it by Add ChildActorComponent, casting it to BP_Region to finally execute Set Paths function that will invoke several setter functions.
When new actor BP_Map is created in editor it executes flawlessly. Problem occurs when I change public size variable and construction script is run again - some regions do not update their variables. I have noticed in editor that whenever I reduce size variable new Child Actor Components are not created, instead old ones are being reused, while Add ChildActorComponent gives me reference to newly created and most importantly not spawned BP_Map actors. Setter functions are run, but not on the Actor Components present in the editor.
Is there some possibility to force spawning new actor components in construction script? is there possibility to get references to Child Actor Component that are actually used?
Best regards and thanks for your support!
Follow this question
Once you sign in you will be able to subscribe for any updates here