I want to prevent the players from spinning or being a ragdoll when they hit hard while running or dashing.
Here is the video of character when he hit the part.
Is there some script to prevent the player from being ragdoll when hit hard?
I want to prevent the players from spinning or being a ragdoll when they hit hard while running or dashing.
Here is the video of character when he hit the part.
Is there some script to prevent the player from being ragdoll when hit hard?
I believe you can use the Humanoid’s SetStateEnabled function to disable the Ragdoll and (I think as well) FallingDown states to prevent that issue
Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
should i put this on local script or server script?
I’m not sure which would be the better choice, try both and see which one is the better approach
Make sure Humanoid
is a variable that leads to the character’s humanoid, which would probably mean putting the end script inside of StarterCharacterScripts and doing script.Parent.Humanoid
still not working, I tried to put it in local script and server script
Perhaps make it set the state to be false when you’re able to dash towards something and set them to true once the dashing is over?
Try this:
task.wait(1)
local Humanoid = script.Parent:WaitForChild('Humanoid')
Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
local bg = Instance.new('BodyGyro',script.Parent:WaitForChild('HumanoidRootPart'))
It worked, thanks a lot. I just putted it in the last part of the script <3