Hey ya’ll! I’ve been making a rolling script so that the player can dodge in my fighting game. I have been using BodyVelocity to shoot the player forward. However, when the player bumps into a part that is too large they bounce off and go flying or glitch out. I thought that disabling the Ragdoll or FallingDown statetypes would prevent this, but this didnt seem to work consistently.
https://gyazo.com/45f196f1f169b092fc529429cbda11d9
I think that the solution is to stop the velocity if the player touches an object too large or too tall, but i cant seem to figure out how to do this. here is the part of the script that controls the velocity:
if debounce == false and locked.Value == false then
player:SetAttribute("Stamina", player:GetAttribute("Stamina") - 60)
debounce = true
local BV = Instance.new("BodyVelocity")
BV.Parent = HRP
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = HRP.CFrame.lookVector*90
roll:Play()
wait(0.2)
BV:Destroy()
hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
wait(1)
debounce = false
(the rest of the script is elseifs that determine other things so ignore the missing end)
Thanks for any help in advance!