I’m trying to build a system where you could change the specific class to use for the light of a car in the editor:
All these classes are derived from the same base class BP_light.
That means, if the level designer chooses another class, I have to destroy the currently used lights and spawn new ones of the selected class instead. Unfortunately it’s forbidden to spawn new actors in the construction script for some reason:
So I tried to implement this with child actors instead. But it also seems impossible to change the specified class for a child actor in the contruction script (there is simply no setter node for the class to use for the child actor):
Next, I tried to destroy the child actor and add a new one with “Add child actor component”, but you can’t set the class to use there either!
Instead, the description says something about a ‘template name’ which could be ‘found in the owning blueprint’. But I can’t find this setting also.
So here’s my question: How can I replace an (child) actor of a blueprint in the construction script with an instance of another class?
I know it’s no problem on runtime with ‘Begin Play’ but I want to configure this parts directly in the editor instead of starting a game each time to see the result…
no, unfortunately, there seems to be no solution for that. UE4 is really inflexible if terms of composing when not using C++. It’s really a pain in the neck. I made dozents of workarounds for this to preconfigure child actors.
You can only vote for this trelly card here:
(A few days ago this was named ‘preFabs’ and had about 450 votes)
And the component template issue is a weird. It only shows up when you add child actor component while pulling off of a mesh. So my assumption is that it’s already done for you it just doesn’t say it.