Attach a ragdoll skelmesh to a socket on a pawn?

I’ll like to impale my player on a socket on my enemy’s skelmesh.

I’ve tried the following in my enemy’s pawn:



simulated function ImpaleCorpse(MyPlayerPawn p) 
{
        if (p!= none && Mesh != none) {
            p.SetBase(Self,, Mesh, 'HornSocket');
        }
    }
}


My player’s corpse remains ragdolled on the floor, and seems to twitch like it’s trying to be moved by the enemy, but something seems to be fighting it actually working correctly.

Any advice would be much appreciated.

I do something like this by setting the RB position by bone every frame


Mesh.SetRBPosition(HangLoc, 'Bip01-L-Hand');

where ‘Mesh’ is the pawn mesh, ‘HangLoc’ is the absolute world location where it’s impaled, and ‘Bip01-L-Hand’ is the bone name that is impaled

Thanks Chosker. I just tried that. It seems the physics spaz out. The corpse does get dragged around, but the mesh is getting stretched and is jumping all over the place.



simulated function Tick( float DeltaTime )
{
    local vector boneLoc;
    local rotator boneRot;

    super.Tick(DeltaTime);

    if (GrabbedCorpse != none) {
        Mesh.GetSocketWorldLocationAndRotation(MouthSocket, boneLoc, boneRot);
        GrabbedCorpse.Mesh.SetRBPosition(boneLoc, 'Bip001-L-UpperArm');
    }


I’m making some progress using the RB_Handle class (which is what the UTWeap_PhysicsGun uses).

The trouble I’m finding is that it never hard attaches to the bone location, and is very springy with it’s attachment. Does anyone know how to remove the springy-ness when using RB_Handle?

Ultimately you probably want to create a constraint between the ragdoll bone and a kinematic rigid body.

Update the position of the kinematic body to match the “impaling socket” every frame.

Thanks for the input OptimisticMonkey. I managed to fix it by providing the specific location of the bone when calling GrabComponent():



Mesh.GetSocketWorldLocationAndRotation(MouthSocket, mouthLoc, mouthRot);
limbLoc = GrabbedCorpse.Mesh.GetBoneLocation('Bip001-L-UpperArm');
PhysicsGrabber.GrabComponent(GrabbedCorpse.Mesh, 'Bip001-L-UpperArm', limbLoc, true);