[Question] Attaching bones at runtime

Is it possible to attach bones to other bones at runtime ?

Let’s say I have modular character. One possible pieces are shoulder pads and skirt. Both have their own bones.
At this stage it would rather pointless to create ultimate skeleton that will support all possible rigged attachments combinations. Skirt have it’s own rig and shoulder pads their own rig.

I mean attaching diffrent skeletons so they can interact with each other, and primary skeleton can drive movment of secondary (like skirt is semi physicallized and will collide with rest, and shoulder pads will fallow movment of arms and on top that will have some physicalized secondary movment).

Is it possible to combine two rigs at runtime ?

What we recommend for this case is to use Master/Slave Pose Component system (Used to be ParentAnimComponent in UE3). What this does is the Master drives all animations and physics, and Slaves component follows what Master component does. For example, you can have invisible Master Component that contains all bone structure, and each mesh part will be attached to Master Component. The limitation is Slave component should match partial bone hierarchy of Master component. You can have head, torso, legs to be each mesh part, and they can be any mesh.

We also support mesh composition in run-time, but in that case, you create whole copy of mesh and duplicate it and compose to new one. For animation, you’ll have to have some hierarchy that matches, so that after mesh is created, assign the skeleton you want, and apply animation.

Thanks,

–Lina,

Thanks. I have another questions.

By Master/Slave Pose Componenet system, do you mean importing mesh splited into parts, then creating blueprint with master component (let’s say simple plane or box riged to skeleton), and then on top of it adding our character parts ?

If master component is supposed to contain entire bone structure, doesn’t it make it redundant ? For example, entire skeleton for all cases might have even 400+ bones, to accommodate various possible cases.
I’m not sure about it, but with even few (10-20) characters on screen, with such complex skeletons, would probably cause an issues.

Is it not possible to let’s say create master skeleton that contain all possible bones, which are connected, and then before exporting split it, into modules ? Like:

-base body (arms, chest etc).

-Hair.

-Armor parts.

-other possible attachments.

And then at runtime, attach to base base body, other bones, that fit into skeleton structure ?

So the characters that doesn’t need anything special, would use only simple skeleton, and those who need more complex animations, would use other parts of skeleton.

Or another case. Let’s say I create various skeletons that have the same core bone structure (for body), and differs with bones for attachments and other special cases,
Is it possible to use them, with the same animation blueprints and body parts that are bind to different skeleton variation of the same base skeleton ?
I think it’s not possible, but haven’t tested it, to be 100% sure.

I ask because, especially if the last paragraph is not possible, it forces us to create various skeletons, (or ultimate skeleton), for different characters that sometimes doesn’t differ that much.

It would be huge time saver if we could, attach skeleton parts on runtime, especially for games that want to have robust character customization (and who doesn’t want it ?). Because once we have created our modules, we could just composite them directly inside engine, without worrying that mesh have to many bones, or it will not fit, because it have 3 more bones in different place for gun (;.

In the Master/Slave relationship, slave does not do anything, but follow Master’s bone transform. Thus, Master needs all the bones that need to animate. This is useful when you have animation with modifiable parts that can animated together.

If you just have simple base skeleton, and use that for animate, then you still can do this but use attach system to attach other parts. However, with attachment system, you have to sync animation if each attachment has animation, which can be tricky. Master/Slave system solves this by giving all control to Master.

For Fortnite, we used to use Master/Slave for main body part, but use attachment for any accessories (such as bags, hats).

Thanks,

–Lina,

I’ve recently ran into a very similar issue, there is an iffy fix I have found.
If you have an actor spawned in on play i.e. the hair armor and such, and attach to socket of choice once it could help.
In order to attach something to socket it already has to exist in the level to begin with so you would have to spawn whichever blueprintActors have been picked (Hair 03, Clothes01, Boots02) into the level, then attach to socket. In that way, each blueprint actor can contain whichever skeleton it needs to, plus animations, then attached.