User Tag List

Results 1 to 6 of 6

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

  1. #1
    0

    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:
    Code:
    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
    0
    I do something like this by setting the RB position by bone every frame

    Code:
    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
    0
    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.

    Code:
    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');
        }

  4. #4
    0
    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
    0
    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
    0
    Thanks for the input OptimisticMonkey. I managed to fix it by providing the specific location of the bone when calling GrabComponent():

    Code:
    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
  •