User Tag List

Results 1 to 6 of 6

Thread: Attach a ragdoll skelmesh to a socket on a pawn?

  1. #1

    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.

  2. #2
    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
    Help me back! follow me on Twitter

    Developer of Elium - Prison Escape

  3. #3
    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;
        if (GrabbedCorpse != none) {
            Mesh.GetSocketWorldLocationAndRotation(MouthSocket, boneLoc, boneRot);
            GrabbedCorpse.Mesh.SetRBPosition(boneLoc, 'Bip001-L-UpperArm');

  4. #4
    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?

  5. #5
    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.

  6. #6
    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);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts