Help with BodyPosition

Hi! I made a simple dashing script using BodyPosition. The problem is when I dash into a wall, my character just flops to the ground. Here’s the script.

Char.Humanoid.JumpHeight = 0
local velo =“BodyPosition”,Char.HumanoidRootPart)
velo.MaxForce =,100000,100000)
velo.D = 1000
velo.P = 40000
velo.Position = Char.HumanoidRootPart.CFrame:ToWorldSpace(,0,-30)).Position
Char.Humanoid.JumpHeight = 7.2


Hello, BodyPosition is deprecated, so it’s not recommended to use for your scripts.
You now use AllignPosition instead of BodyPosition

i would recommend doing a dash like this

-- look force
local force = Char.PrimaryPart.CFrame.LookVector * 50

-- up force
force += Char.PrimaryPart.CFrame.UpVector * 1

-- make the player jump 
Char.Humanoid.Jump = true

-- add the force to the velocity
Char.PrimaryPart.AssemblyLinearVelocity += force