How can I prevent my character from falling over

My problem is that my character flings every time I dash and bump into something. I tried multiple ways to fix this like changing the humanoid state but they didn’t work well. This is the best I got:
robloxapp-20230701-1624037.wmv (2.3 MB)

This is the script I used:

humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
humanoid.StateChanged:Connect(function(old, new)
	if new == Enum.HumanoidStateType.Ragdoll then
		root.RotVelocity = Vector3.new()
		root.Velocity = Vector3.new()
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
		humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
	end
end)