Any way to fix my character flinging when hitting the ground at a high velocity?

Im working on a ability for a game that I work for. Im having a issue with my character flinging when i hit the ground at a high velocity. I want the player to do a downwards kick after hitting a input at a certain time frame. I will post a video and the script I have right now.

Example:

Script (only including parts of the script related to the issue):

	local function slam()
			placeholderrun:Disconnect()
			print("its ovar")
			LV:Destroy() -- Velocity
			task.spawn(function()
				for _ = 1,5 do task.wait()
			attacker.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
					attacker.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
		
			end
			end)
		end	
		
local runn = game:GetService("RunService").Heartbeat:Connect(function()
	print("???")
	local wat = workspace:Raycast(attacker["Right Leg"].Position,Vector3.new(0,-7,0),params)
			attacker.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
			attacker.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
	if wat then
		slam()
	end
end)
1 Like

bump, still need help with this

1 Like

There is a few issues here, first, you should make velocities on the client with replication but if you dont want to do that, then first, make sure in a local script, you turn off

Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)

Do it locally and you’ll most likely never have to turn these back on so you can just set them off one time in a local script. if you do for some reason have to turn them on then turn them on and then off again with whatever the situation is needed.

Second, the velocity you are using, I really need to see it if I want to know whats going on but my best bet is that you set the maxforce a little to high

vectorForce.MaxForce = 30000

This is a proper maxforce for a character, there is a formula you can get for any character of any sizes but as long as your player models are staying at similar size, you dont have to do that.

Third, it could be the rotation of the character, so we could lock it off doing it this way,

local Torque = Instance.new("BodyGyro")
Torque.Parent = Character.HumanoidRootPart
Torque.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
2 Likes

thank you! This fixed it. I moved the whole raycasting and runservice mechanics to the client and used these methods and it worked.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.