PlatformStand resets to false when jumping [help please]

I have this server sided ragdoll code that can ragdoll and unragdoll a player. It works very well but there is one problem that I can’t figure out.

When I am jumping/falling and I get ragdolled, the humanoid’s platform stand property somehow gets set back to false even when I set it to true.

I tried looking through my code using ctrl + shift + f but I couldn’t find anything that would’ve changed the platform stand property.

As you can see, I can move around and jump while ragdolled.

These are the only places where I believe platform stand could be changed:
image
image
image

this is the ragdoll code, state means ragdoll or not.

if state then
	Humanoid.PlatformStand = true
	local weldConstraint = Instance.new("WeldConstraint")
	weldConstraint.Part0 = characterSubject.HumanoidRootPart
	weldConstraint.Part1 = characterSubject.Torso
	weldConstraint.Name = "RagdollWeld"
	weldConstraint.Parent = characterSubject.HumanoidRootPart
	
	characterSubject.HumanoidRootPart.RootJoint.Enabled = false
else
	
	Humanoid.PlatformStand = false
	characterSubject.HumanoidRootPart.RootJoint.Enabled = true

	if characterSubject.HumanoidRootPart:FindFirstChild("RagdollWeld") then
		characterSubject.HumanoidRootPart.RagdollWeld:Destroy()
	end
end

Does anyone know what might be setting platformstand to false?

Okay so I found out that my humanoid’s state kept changing to ‘jumping’ (when I was jumping) which somehow set platformstanding to false. I just used SetStateEnabled for the jumping state, so when I’m ragdolled, it’s false and when I’m not ragdolled, it’s true.

I also moved the actual setting of platform standing to the client side if that does anything, but it works perfectly fine now.

Try undoing that change and setting network ownership of the ragdolled character to nil.

Client most likely has ownership over the character and thus can overwrite the states the server puts them in, especially if it changes state before it even knows it’s supposed to be platform standing.

I recommend undoing it just to verify that that is in fact the culprit otherwise the same issue could happen with different states (or exploiters)