local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Dash = ReplicatedStorage.RemoteEvents.Dash
Dash.OnServerEvent:Connect(function(player,DashKey)
local HumanoidRootPart = player.Character:WaitForChild("HumanoidRootPart")
local dashvelocity = Instance.new("BodyVelocity")
dashvelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
dashvelocity.Parent = HumanoidRootPart
if DashKey == "W" then
dashvelocity.Velocity = HumanoidRootPart.CFrame.lookVector * 25
wait(0.60)
dashvelocity:Destroy()
elseif DashKey == "A" then
dashvelocity.Velocity = HumanoidRootPart.CFrame.rightVector * -25
wait(0.60)
dashvelocity:Destroy()
elseif DashKey == "S" then
dashvelocity.Velocity = HumanoidRootPart.CFrame.lookVector * -25
wait(0.60)
dashvelocity:Destroy()
elseif DashKey == "D" then
dashvelocity.Velocity = HumanoidRootPart.CFrame.rightVector * 25
wait(0.60)
dashvelocity:Destroy()
end
end)
so my problem is when u dash and turn the camera it just keeps going in a straight line instead of where the camera is pointing so how would i fix that
https://gyazo.com/f58167fa10fbf181c1c52ad370ee1f09