Modular Character - Attaching Body Sections & Ragdolling?

Hi!

I’m a little less than two weeks into UE4, and I’m loving it so far!

I always like to try to do things on my own, but this has been something since the beginning of this personal project that I haven’t quite been able to figure out, so I think I might just need some help to get moving in the right direction!

I have unique meshes for the Head, Torso, Legs, Hands, and Feet… and I just can’t think of a way to join them together to the same skeleton and then follow the same collision when they’re ragdolling or animating! Ideally, I’d like for the body parts to snap to an invisible base “skeleton” and then for the Physics Asset I created to work on just the “skeleton”, with the “body parts” getting dragged along for the ride and properly deforming with the bones as they ragdoll around.

Does anyone happen to know if this is possible? I’ve looked all over the place but it seems that nobody quite has the information I need.

Thanks!

You need to set a master pose component.

This can be done in C++ or Blueprint.

In GB, our character’s mesh is used as the head and master component.
Legs, torso & hands are attached at runtime and then have SetMasterPoseComponent() called.
The one thing to remember is to create a physics asset for your master component that covers the whole body.
i.e. Our physics asset has physics bodies for spine, legs, arms etc, despite being just a head.

That worked great, thank you so much!

I’m running into a slightly different issue now… Not sure if this would quite be for the Blueprint section or not, if so then I apologize!

With your help they all morph together and even ragdoll together! But, the morph targets only work on the base mesh :eek: (I used the torso, in my case).

I’m… slightly embarrassed to be posting how I threw this all together in Blueprint (it’s really just to test things out), since I’m sure there’s probably something horribly wrong that I’m not seeing… But it seems like “Mesh” strips the morph targets off of all of the others. So I figure this is still “Skeletal Mesh” enough to be in the Animation section. Anyway, I was able to dig enough to find that other people had similar issues, but usually there’s no answer at all when they ask or they solved it by applying the morph to just the “master” mesh which doesn’t seem to work in my case.

Glad the master pose worked for you.
As for the morphing, I don’t have enough experience with it to comment. It sounds like you’ve taken a look on the forums and answerhub already, so I’d suggest posting a question about it on the answerhub (if you haven’t already).

Thanks for the suggestion! But, I asked a couple days ago and no replies as of yet. Hopefully there’s a way around it out there, I’ll have to do some more digging.

I’m trying to get ragdoll working with modular head and i have a problem:
In my character blueprint, i have a “Body” skeletal mesh component and a “Head” skeletal mesh component. In construction script i SetMasterPoseComponent of “Head” to “Body” - and in “Head” mesh i’ve set physics asset to the same one as in “Body” mesh, which has collisions for all body parts, head as well. But when it simulates (in game), the head detaches from the rest of the body and it causes twitching of whole body. Ofc, both are rigged to the same skeleton. Am i missing something?

Edit: Screenshot after simulating physics:
126deae29d062279a9359e4678594e10a09e93f6.jpeg

Edit2: I think that it’s because each part (body and head) is simulating physics separately (as they’re separate skeletal meshes) … But how to set it up right?

OMG, thank you, I’ve been looking for this for ages. Man, that was easier than I thought. Thanks again.

Slavq - as I understand you set physics asset for the head the same as the body. No, the only component which needs a physics asset is the body, head when being a slave is only decorative. So, body has the physics asset with the head collision and the head has no physics asset at all.

Boom, should work.

Boom, it works :slight_smile: Thanks!
Dzięki :wink:

Also important to have the slave meshes as children to the master mesh. Only the master mesh needs an physics asset.