LinearVelocity problems with player

Currently, I am trying to make a simple roll / dash that the player can use for mobility in my game. I am using 2 linear velocities to calculate the movement of the dash. 1 linear velocity handles the movement of the roll itself and the 2nd linear velocity handles the “gravity” of the roll so the player can’t roll mid-air.

However, on ramps, there is a lot of glitchy movement and I was wondering what I could do to prevent it.
Bellow is my script and a gyazo link to the gif of the movement not working properly.

-- some more code here blah blah blah doesnt matter
local attach = Instance.new("Attachment",character.HumanoidRootPart)
local dash = Instance.new("VectorVelocity",character.HumanoidRootPart)

dash.MaxForce = 1000000
dash.Attachment0 = attach

local grav = dash:Clone()
grav.Parent = character.HumanoidRootPart
grav.RelativeTo = Enum.ActuatorRealtiveTo.World
dash.RelativeTo = Enum.ActuatorRelativeTo.Attachment0

dash.VectorVelocity = Vector3.new(0,0,-1) * 45
grav.VectorVelocity = Vector3.new(0,-1,0) * workspace.Gravity/4.9

debris:AddItem(dash,0.45)
debris:AddItem(grav,0.45)

-- some more code here blah blah blah doesnt matter

Gyazo link

Any advice would be greatly appreciated!

I think the velocity that moves forwards is trying to push the player into the ramp, so they ragdoll and have lots of weird movement. You could use a raycast and set the velocity lower if there is an object very close to the player.

Try decreasing the max force of the linear velocities.

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