I have an array of Skeletal Mesh Components on my ACharacter BP that handles setting equipment values on parts of the body.
Is there a way I can set the skeletal Mesh components added to the actor in the Components section to that array directly in the editor before runtime?
Can you screen shot what you mean?
A Character subclass will have one Skeletal Mesh Component added to it, which you cannot remove.
To set the Skeletal Mesh Asset for that component, simply select the component instance in the editor and choose the skeletal mesh asset it should reference.
In general, you don’t create an array of components that are not attached to actors – maybe what you want is an array of skeletal mesh asset references, or perhaps an array of “equipment specifier structs” which contain a bunch of data (stat changes, etc,) as well as references to skeletal mesh assets, and the name of a skeletal mesh component that the asset gets assigned into? And then pre-create skeletal mesh components for each of the equipment slots (chest/legs/weapon/shield/helmet and so on) with well-defined names?
Sorry, I meant refs for Skeletal Mesh Comps. Close to what you meant with the latter part - with items having a Skeletal Mesh Asset to be fed into the Comp.
Basically, where I’m at with the functionality is that I’m trying to add these Skeletal Mesh Comps:
Into this array:
But the issue is that there are no references to add to the list. In C++ the variable is set as
TArray<USkeletalMeshComponent*> MeshComps;
The parent skeletal mesh comp is set as the Master Pose Component.
That sounds like a weird use case to me. You already have them in blueprint. Why do they need to go into an array?
Components make little sense outside of the actors that they refer to.
If you want an array (or map!) of “slot name” to “skeletal mesh component,” you could build that dynamically in the construction script, by adding each of the components to the container, OR you could iterate over all children of the top Mesh component, and add each of them to the container, to avoid having to get a reference to each in the blueprint.
However, this variable, if you make it, should be marked “transient” and should not replicate and should not be part of the savegame, for best results.