Whenever a Players Character gets ragdolled, they always do this little jump / fling before standing up… sometimes it works and makes the Character stand with no weird jumps or bugs.
Here’s a video of the problem:
Un-Ragdoll Function
I’m assuming the jumping issue is either caused by the custom idle / walk and run animations I made OR through this function that makes the Character stand up from the ragdoll state.
function unragdollCharacter(character)
local player = Players:GetPlayerFromCharacter(character)
local humanoid = character:FindFirstChild("Humanoid")
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
print(player)
if player then
if humanoid:GetState() == Enum.HumanoidStateType.Dead then return end
humanoid.PlatformStand = false
humanoid.AutoRotate = true
humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
else
if humanoid:GetState() == Enum.HumanoidStateType.Dead then return end
humanoid.PlatformStand = false
humanoid.AutoRotate = true
humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
destroyJoints(character)
enableMotor6D(character, true)
enableCollisionParts(character, false)
local isRagdolled = character:SetAttribute("IsRagdolled", false)
end
If you’ve ever played any games with ragdoll physics, you’ve probably seen that it might or might not fling player in same way as show in the video. This is just roblox’s physics and ragdoll mechanics, so you eather live with them or create your own ragdoll physics.
first it will change the humanoids state to GettingUp so the player will stand up faster,
then after that it will make sure the player dosnt bounce up when standing
Okay so, I just had a Lightbulb moment and came to realise… I was handling the ragdoll and unragdoll movements on the Server which causes A LOT of problems with flinging and other bugs like that… so I just made 2 remotes that fire that do the exact same code but on the Client… since it’s movement it gets Replicated on the Server anyway… regardless of that- thanks for the suggestions and ideas dude!