"Grab" a ragdoll by a bone?

I’m sure there’s a way to do this, but the heck if I can find it!

I’ve got a few attacks that grab/swing the enemy in question; for visual reasons, I want the enemy to temporarily enter a ragdoll state when these attacks trigger, so the enemy is flung around limp and then re-blends to his animations on landing. I can handle this just fine by setting physics blend weights

The problem is, if I try to go full ragdoll (i.e. not simulate just part of the mesh), then the enemy’s collision capsule moves but the mesh simply crumbles into a heap! Going full ragoll detaches the mesh from the capsule (effectively), so it doesn’t move with it. What I need is a way to simulate physics on all bones EXCEPT a single bone (be it torso, or leg, or whatever), or else simulate physics and manually attach/copy locrot a bone for the duration of the effect.

It seems like this should be doable; you can do it in your PhAT sim with the poke controls! But I can’t find a way to achieve this in-game, so that the ragdoll asset is dragged along by the bone in question.

And I realize that reconstructing the skeleton might work, so that all of the bones (“below” an invisible parent bone) simulate, but this doesn’t work if I want different attacks to function differently; i.e. have one attack where the enemy is caught by his chest, another where he’s caught by his legs, etc.

I think you might want to add a socket to the ragdoll. Most things connect to the hands via a socket.

I don’t think that works. The problem is I would need to set the relative location of a bone in a way that would update the physics asset; I can add forces at bones (impulses, momentum, whatever) but I can’t set their location or rotation.

Use a UPhysicsHandleComponent, call the grabcomponent function so it grabs your mesh / physical asset and then use the SetTargetLocation and provide the location to move the component to

You can check how its exactly done in the Content Examples demo, physics map

This doesn’t seem to do anything, alvarofer. I must be doing it wrong, can you see where my mistake is?

Pic related is the BP I’m using. As far as I can tell, this should work, right? I have a physics handle component on my pawn (attached at the root like a movement component, which I can’t change). When I trigger the ragdoll, the whole skeleton simulates physics. Then, I attach the handle to the bone I want to “carry” using (which in this case is a reference to a bone called SpinalBase which I’m pulling from somewhere else). Then I use a timeline to tick the location of the handle using set target loc and rot, which is fed using the pawn’s capsule.

The end result SHOULD be that the mesh goes full ragdoll, but the torso is attached to the capsule and moves with it, with the rest of the ragdolling mesh being carried behind. Right?

But in practice…

the skeletal mesh remains stationary and crumbles into a heap, completely ignoring the position and rotation of the actor’s capsule.

I feel like maybe the handle is the wrong way to go for this specific task… I’m instead using a physics constraint, which ought to be a more effective solution.

Now, I have a really interesting problem here, and one I can’t quite pin down.

The ragdoll is connected to the capsule via a constraint to its torso bone, which works…

…until the asset is told to blend back into animation and stop simulating physics, at which point it utterly explodes…

…and then reassembles itself in the incorrect position where it began its ragdoll.

Never mind, this is resolved. The problem is, Unreal seems to be incorrectly determining location and rotation when told to “Reset Relative Transform”.

By breaking the constraint and then telling Unreal to set the WORLD transform of the skeletal mesh to the capsule’s transform, offset by its own relative transform, it works just fine. This is probably a bug, which I’ll report on the answerhub.

do you have an example blueprint ?

Could you post more picture of your blueprint? I’m trying something similar, but I’m a newbie.

Can you post an example of your use of the Physics Constraint-based approach? Is the Capsule Component that your ragdoll is following part of the Player Pawn, or is it just another Actor in the Level?
I’m trying to assign and unassign a Physics Handle’s Constraint Components via Blueprint (attach to a VR hand and let go) and I’m getting null Actors and warnings about not being in the same scene.