I have a script that slides the character using BodyVelocity in my game. Whenever I slide into an object, the character will fall and bounce away and I'm trying to fix this.
Ive tried disabling humanoid states with this:
hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false) hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false) hum:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
which hasnt helped, any other solutions?
BodyVelocity Is Deprecated, meaning It will no longer work on new work, Instead, simply use VectorForce which more Information can be found here: https://developer.roblox.com/en-us/api-reference/class/VectorForce?adlt=strict&toWww=1&redig=F2CD645E683C41FA8C268A6FA7F4F231
(Note: The Information there might be outdated though)
You could just detect the state that changed, and see if its any of the ones you down want, then, set the state to freefall
Humanoid.StateChanged:Connect(function(old,new) if new == Enum.HumanoidStateType.Ragdolling or new == Enum.HumanoidStateType.FallingDown if new == Enum.HumanoidStateType.Ragdolling or new == Enum.HumanoidStateType.Climbing then Humanoid:ChangeState(Enum.HumanoidStateType.FreeFall) end end)
Alright no more problems, i'm here to help you!
Let's use RunService in order to make it run every frame!
It's also a ServerScript
local PlayersService = game:GetService("Players") local RunService = game:GetService("RunService") PlayersService.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) RunService.Heartbeat:Connect(function() char:FindFirstChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Climbing, false) char:FindFirstChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.FallingDown, false) char:FindFirstChild("Humanoid"):SetStateEnabled(Enum.HumanoidStateType.Climbing, false) end) end) end)