Wait Problem with Dash

well i guess it doesnt support tps, but not so sure as i didnt test it

1 Like

Thank you so much bro! but i have one question , how to it rotate with the camera because it only takes direction when i press q and i cant change it , i need it to change direction when im rotating camera

-- [[ Settings ]] --
local Dash_Speed = 100; -- Change this to your liking
local Dash_Duration = 0.7; -- Change this to your liking
local Dash_Range = 0.15;

-- [[ Variables ]] --
local Lifetime = 0.15;
local LookVector = HumanoidRootPart.CFrame.LookVector; -- Change this

local BV = Instance.new'BodyVelocity';
BV.MaxForce = Vector3.new(50000, 0, 50000);
BV.Velocity = LookVector * Dash_Speed;
Debris:AddItem(BV, Dash_Duration);

local StartTime = os.clock();
local Con;

Con = RunService.Heartbeat:Connect(function(DT)
    Lifetime -= DT;

    if BV == nil or BV and BV.Parent == nil then Con:Disconnect(); Con = nil; end
    if Lifetime <= 0 and Con ~= nil then Con:Disconnect(); Con = nil; end
    
    if StartTime - (Dash_Duration - Lifetime) > (Dash_Duration - Lifetime) then
        local Decrease_Rate = 0.15; -- Adjust to your liking
        local Velocity = (Lifetime * Dash_Speed) / Decrease_Rate;
        
        Velocity = math.clamp(Velocity, 0, Velocity);

        local Direction = workspace.CurrentCamera.CFrame.LookVector * Vector3.new(1, 0, 1);
        BV.Velocity = Direction * Velocity;

    else

        local Direction = workspace.CurrentCamera.CFrame.LookVector * Vector3.new(1, 0, 1);
        BV.Velocity = Direction * Dash_Speed;
    end

end)

Really works, Thank you so much!

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