Does anyone know how to instantiate a new child array blueprint in edit mode? (The opposite of runtime) For example… suppose I have a parent class named MyParent, and a child class named MyChild. Since I don’t know C++ very well, I know in C# I would do this…
List<MyChild> children = new List<MyChild>();
is this possible in a blueprint, or is SpawnActorFromClass the only way?
There is a child actor component that may be useful to you.
Add a ‘Child Actor’ component to your parent blueprint. In the details panel of the Child Actor you can select a ‘Child Actor Class’. You can then set any instance editable variables that you have in your child class at ‘Child Actor Template’.
This is of course only setting up one child actor. But you can have several Child Actor components in your blueprint and then add them to an array if you wish to loop through them.
If you don’t know at edit time how many child actors you need (or if you need a very large number), I would probably go with SpawnActorFromClass instead.
I am not looking to spawn the child blueprint into the scene. I would like to use the child blueprints to hold the static mesh array and its properties. The parent blueprint does drawing of the meshes. I know I could use a struct for this, but I cannot cast a struct, which I need to pass in as an input variable of a function.
I an not at my computer right now, but I can explain it in more detail when I get home.