Whats the best way to do this?

hi, so i was trying to make a dashing system for my game, it will make them dash in the direction they are looking. if the direction they are looking in changes, so will the direction of the dash, accordingly. i’ve tried a few different ways but all of them have nor changed with the lookvector if it does change. any ideas? what’s the best way to do this?

1 Like

connect a function that changes the direction of linear vevlocity if the characters direction changes, llike this:

linearForce = ....

local temp = character.RootPart:GetPropertyChangedSignal("Orientation"):Connect(function()
  linearForce.Direction = character.RootPart.CFrame.LookVector
end)

wait(duration)

temp:Disconnect()
linearForce:Destroy() 

3 Likes

Use LinearVelocity, and the RootAttachment in the HumanoidRootPart for the attachment. Set the Enum.RelativeTo to the attachment. And tween the force down to their walkspeed or 0.

If you want them to be able to jump, change the ForceLimitMode to PerAxis, and set the y to 0 (it will apply no force up and down).

2 Likes