Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Roll ability sends character flipping when he hits a wall?

Asked by 6 years ago

I made a roll ability with a roll animation. I pretty much puts a temporary body velocity that makes the character go forward pretty fast. However, when they hit a wall their character sometimes goes flying or gets knocked down. I have seen some games where the character has a similar dodge ability but can hit a wall and not be effected.

local anim = Instance.new('Animation')
anim.AnimationId = 'rbxassetid://01581785274'
local playAnim = character.Humanoid:LoadAnimation(anim)
playAnim:Play()
local bv = Instance.new('BodyVelocity')
bv.Parent = character.HumanoidRootPart
bv.Velocity = character.HumanoidRootPart.CFrame.lookVector * 75
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
wait(.5)
bv:Destroy()
playAnim:Stop()
wait(3.5)

This is what it does pretty much, if anyone knows how i could stop this i would appreciate it, thanks.

0
I think you should put before playAnim:Play() you should put playAnim.Priority = 2 Ind1v1duals 43 — 6y
0
why is that? PoePoeCannon 519 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

its because math.huge is too much it means it will use alot of force to go forward ive tried it with 9999 and it worked fine after.

0
thank you very much. PoePoeCannon 519 — 6y
Ad

Answer this question