Ragdoll is just frozen in air

So I use a series of methods to create a ragdoll, such as BallSocketConstraints (to connect the player’s body parts), :ChangeState(Enum.HumanoidStateType.Physics) [to simulate it looking like a ragdoll], and the disabling/enabling of Motor6Ds. However, only the person who is being ragdolled can see the ragdoll so I have to use :FireAllClients() so other clients can see the ragdoll. But the bad thing is that the event fires correctly, but the ragdoll from other clients.

How do I fix this or create a better method instead of using :FireAllClients()?

gyazo link to show the frozen ragdoll: https://gyazo.com/81e84197296e7e1fbe71c427b9167f9c

script with :FireAllClients() in it:

local RemoteEvent = game.ReplicatedStorage.FallMechanic.CommitRagdoll

RemoteEvent.OnClientEvent:Connect(function(character, getUp)
	if not getUp then
		for i, v in pairs(character:GetDescendants()) do
			if v:IsA("Motor6D") then
				v.Enabled = false
			end
		end
		
		character.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
	elseif getUp == true then
		for i, v in pairs(character:GetDescendants()) do
			if v:IsA("Motor6D") then
				v.Enabled = true
			end
		end
		
		character.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
	end
end)

(getUp is a variable of either true/false so if getUp is false, then it will ragdoll. if getUp is true, the ragdoll will get back up)

1 Like

You arent replicating the motor6d to the server, remember always replicate stuff to the server when cloning or re parenting

im not deleting/cloning the Motor6D lol im changing the property of Motor6D called “Enabled” to false to disable it

how can i replicate the Motor6D’s changed properties? is the :ChangeState option okay to put in the script i showed?

You’re disabling the Motor6D on the client, not the server. That’s why it shows frozen for other players, and not you.
Easy fix to this is to disable the Motor6D’s on the server-side.

what about the :ChangeState()? do i do that on all clients or serverside?

actually, i put :ChangeState() in the :FireAllClients() event and disabled the motor6ds on the server and it works!

bad thing is that in the beginning the player looks a bit frozen then is ragdolled…

example here: https://gyazo.com/b8dbf9fad9023bf132e2646a77e712d2

I’m not 100% on how to solve that. I think it just depends on the player’s connection or something.

Also you don’t need to :ChangeState() if you’re trying to kill the player, you can just set their health to 0 via game.Workspace.EXAMPLENAME.Health = 0

in my game, there’s no ragdolling upon death, i just use :ChangeState(Enum.HumanoidStateType.Physics) to simulate the ragdoll when they take fall damage

That may be the cause of the issue.
Try removing that and see what happens.

Oh and before yo do that, can you tell me when you run :ChangeState()?

uh, removing the :ChangeState()? that’s supposed to make it look like a ragdoll…

Alright. So a little fun fact about the way Motor6D’s work, when a player dies, Roblox automatically removes all Motor6D’s in that player’s character. You don’t need to change anything as a matter of fact if you’re killing the player.
However if you’re disabling the player’s movement for a while, try to set the Motor6D’s to disabled (Which you already did) or store the Motor6D’s in a separate parent temporarily.

Plus constraints already do the physics stuff for you, so if you need to change the humanoid’s state something isn’t working right.

EDIT
Even if the player is stuck on the ground, you don’t have to change their state. You can disable PlatformStand or Sit.

so should i try removing the :ChangeState()?

Yes. You don’t need to change the player’s state as Roblox does it for you.

well without :ChangeState(), it looks like this (in the gyazo link) and you can still control your character… at least it doesn’t freeze though! : D

i think with :ChangeState() would be better so you can’t control your character and it looks more like a ragdoll. i don’t know how to fix the freeze though

link: https://gyazo.com/811c65c7a6c8f7a8e66646bb923ce0e5

Try to remove the HumanoidRootPart Motor6D. Or just remove the HumanoidRootPart in general. OR you can platform stand the user.

EDIT
If you want your limbs to have collisions, place 1x1x1 blocks on the end or center of them.


Or you can clone the limbs and weld them to the REAL limbs.

Unsuprisingly the green blocks ARE the collision boxes i’m refering to.