Announcement

Collapse
No announcement yet.

Attach skeletal mesh with ragdoll physics to weapon

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Attach skeletal mesh with ragdoll physics to weapon

    I'm trying to attach a skeletal mesh (fishing line) to my weapon (a fishing rod). I've created a physics asset for it and attached it as a SkeletalMeshComponent to a socket on my rod.

    Here's my code for my fishing rod firearm class:
    Code:
    class MyFirearm_FishingRod extends MyFirearm;
    
    var SkeletalMeshComponent FishingLineSkelMesh;
    
    simulated function PostBeginPlay()
    {
        Super.PostBeginPlay();
        AttachFishingLine();
    }
    
    simulated function AttachFishingLine()
    {
       Mesh.AttachComponentToSocket(FishingLineSkelMesh, 'rod_tip');
    }
    
    defaultproperties
    {
        //Firearm mesh
        begin object name=FirearmMesh
            SkeletalMesh=SkeletalMesh'PathTo.SkeletalMeshes.fishing_rod'
        end object
    
        Begin Object Class=SkeletalMeshComponent Name=LineSkelMeshComp
            SkeletalMesh=SkeletalMesh'PatchTo.SkeletalMeshes.fishing_line'
            PhysicsAsset=PhysicsAsset'PathTo.PhysicsAssets.fishing_line_Physics'
    
            bHasPhysicsAssetInstance=true
        End Object
    
        FishingLineSkelMesh=LineSkelMeshComp
    }
    The line attaches fine. However the physics asset doesn't play, and the line remains rigid.

    Does anyone know what i'm missing to run the physics simulation on the line?

    #2
    have you tried this?
    https://docs.unrealengine.com/udk/Three/PhysicalAnimation.html#Partial physical simulation on skeletal meshes
    Follow me on Twitter!
    Developer of Elium - Prison Escape
    Local Image-Based Lighting for UE4

    Comment


      #3
      Thanks Chosker, i'll check that out

      Comment


        #4
        how did you make the fishing pole ?

        Comment


          #5
          Hi guys,

          I Have the same problem, but i'm doing this with Blueprint,
          I've a Whip that's a skeletalMesh and i need to attach that whip with ragdoll collision (or something similar) to the hand of my player, but when i try, the whip falls in the ground.

          Can someone help me?

          Comment


            #6
            this is unreal engine 3, blueprint does not exist here
            please go to the unreal engine 4 sub-forums
            Follow me on Twitter!
            Developer of Elium - Prison Escape
            Local Image-Based Lighting for UE4

            Comment

            Working...
            X