Help with a Dragbody System

I was trying to make the drag body system from hitman, but i had some issues with it

local NPC = script.Parent.Parent.Parent.Parent
local DB = false

script.Parent.Triggered:Connect(function(player)
	local PlrChar = player.Character
	local rightArm = PlrChar:FindFirstChild("Right Arm")
	local Leftleg = NPC["Left Leg"]

	if rightArm and Leftleg and not DB then
		DB = true
		
		local weld = Instance.new("WeldConstraint")
		weld.Part0 = Leftleg
		weld.Part1 = rightArm
		weld.Parent = Leftleg
		
		NPC["Right Leg"].CanCollide = false
		
		Leftleg.CFrame = rightArm.CFrame * CFrame.new(0, -1, 0) -- offset 

	end
end)

Here is my system


I know there aren’t animations or stuff like that, but how do I make it so the player actually holds and drags the NPC’s leg.

(there is another ragdoll script by the way, but I am trying to make this without modifying that)

What type of weld should I use if weld constraint is bad?

3 Likes

Have you considered reducing the player’s WalkSpeed, disabling PlatformStand on the dummy’s Humanoid, and ensuring the player is always facing the NPC when entering the dragging state?

Additionally, you could try disabling collisions between the player and the dummy to see if it improves the interaction.

1 Like

Have you thought about using an AlignPosition instance between two Attachments?

It’ll look good if you find the correct properties for this one. It’s even better because the player won’t be able to drag the body everywhere depending on the force applied. Just verify when both (the body and the player) get too far away and disable the AlignPosition.

2 Likes

If you want a smoother result, use inverse kinematics for the arms.

hello again lol…
alignposition and alignorientation might be worth looking into :eyes:

1 Like

you could try offsetting the player instead of the specific limb in order to achieve the effect you want. also, you may want to try offsetting the player before you add the weld.

also, I would like to inform you that you can’t change the collisions of a player (correct me if I’m wrong).
you could also try using different constraints, like BallSocketConstraints.

(this is very unlikely, but the ragdoll system might be interfering with everything)

1 Like

I may be wrong. However, when using BallSocketConstraints if the body gets stuck, the player won’t be able to move.
How do you plan to avoid such an issue? A drop-body mechanic would be necessary. But how do you detect when you drop the body?

how about instead of that, you just weldConstraint the players hand to the enemies leg, or arm, or neck or whatever, and then use IK or a ball socket constraint only on the players arm(s) which are holding the body and after that it should work fine, and then once you let go put back the motor6Ds with the correct part0 and part1 and the correct CFrame,

or in fact, just create a variable that stores the joint before destroying it, so after that you can copy it back over to the player and just set the part0 and part1

or technically if it doesnt have to be realistic just dont even do that, just do the part of welding them together

This works, but I have to set all the body parts collision to false so it doesnt glitch out,

is there a way to make parts collide with some parts and not others?
thanks

Check this article, it talks about collision groups.
I think it is the only way to filter collisions like you asked.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.