I have a dash script that is supposed to teleport the player 10 studs ahead of themselves, but it ends up just teleporting the player to a position completely unrelated.
Here is my code:
(This code only includes the part with the problem)
local function Dash() Moving.Value = true print("Dash Foward") HumanoidRootPart.CFrame = CFrame.new(HumanoidRootPart.CFrame.lookVector) * CFrame.new(0, 0, -10) wait(0.3) Moving.Value = false end
Here try this:
-- Put this on Line 4 HumanoidRootPart.Velocity = HumanoidRootPart.CFrame.lookVector * 300 -- Change this number to what ever you want
If it doesn't work dm me on discord, supernova#0034
If you multiply a CFrame the position will be relative
local function Dash() Moving.Value = true print("Dash Foward") HumanoidRootPart.CFrame = HumanoidRootPart.CFrame * CFrame.new(0,0,-10) wait(0.3) Moving.Value = false end