Hello. I am trying to script a decent dashing system. So far I have tried 3 different methods, BodyVelocity, BodyPosition and LinearVelocity. I abandoned the BodyVelocity one due to it being deprecated. Anyways, what I need is not making character go from point A to B like BodyPosition and LinearVelocity (as far as I observed) does. I want the player to be able to change where they are going while dashing by moving where their character is looking at. So like when they open shiftlock and dash to right side, if they move their mouse then the character will start going to the new right position. Any ideas?
I was told that it is possible with LinearVelocity however my version doesn’t work. Here’s the script. How should I adjust it?
elseif dashSide == "Right Dash" then
print("dash right")
db = true
dashing.Value = true
canDash.Value = false
canRun.Value = false
local totalCharMass = character.HumanoidRootPart.AssemblyMass
local linearVelocity = Instance.new("LinearVelocity")
linearVelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
linearVelocity.MaxForce = math.huge
linearVelocity.LineDirection = character.HumanoidRootPart.CFrame.RightVector
linearVelocity.LineVelocity = 100
linearVelocity.Attachment0 = character.HumanoidRootPart:FindFirstChildOfClass('Attachment')
linearVelocity.Parent = character.HumanoidRootPart
game.Debris:AddItem(linearVelocity, 0.5)
wait(1)
canRun.Value = true
dashing.Value = false
wait(2)
db = false
canDash.Value = true
end