I want to make a dashing system like the game “ULTRAKILL” but
I’ve tried multiple attempts at tweening and those didn’t work.
I have looked for solutions about velocity and such but I have not gotten anywhere
anyways, here’s what I have
local player = game.Players.LocalPlayer
local char = script.Parent
local uis = game:GetService("UserInputService")
local bool = script.DashActive
local tweenService = game:GetService("TweenService")
local hrp = char:WaitForChild("HumanoidRootPart")
local frame = player.PlayerGui.DashGui.Frame
local Counter = frame.Describe
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and bool.Value == false then
--find the direction the player is moving
local humanoid = char:FindFirstChild("Humanoid")
local moveDirection = humanoid.MoveDirection
--here
frame.Visible = true
bool.Value = true
local thewait = 2
Counter.Text = thewait
while thewait >= 0 do
wait(0.1)
thewait -= 0.1
--gui stuff
local RoundedValue = thewait
RoundedValue=math.floor(RoundedValue*10)/10
Counter.Text = RoundedValue
if thewait <= 0 then
break
end
end
frame.Visible = false
bool.Value = false
end
end)
Well I’ll help as much as i remember ULTRAKILL dashing, but i dont remember if its 8 directional or 4 directional.
Even though, considering the dash keeps you in the air (this is how i remember it), you should use a body velocity, with the max force to Vector3.new(math.huge, math.huge, math.huge) and the velocity in , as it is the easiest method. When setting the velocity, I can only help you detect if the player is moving In one of four directions, i am sorry if this doesnt help
local ForB = char.Humanoid.MoveDirection:Dot(char.HumanoidRootPart.CFrame.LookVector) -- forwards/backwards
local LorR = char.Humanoid.MoveDirection:Dot(char.HumanoidRootPart.CFrame.RightVector) -- right/left
-- in here, ForB means Forward or Backwards, and LorR means Left or Right
if ForB > .6 then
-- we are going forwards
elseif ForB < -.6 then
-- we are going backwards
else
-- not moving
end
-- same goes for Left or Right, just replace the ForB with LorR
so an example would look like this
local hrp = character.HumanoidRootPart
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
local power = 10 -- change this
local direction
if ForB >.6 then
direction = hrp.CFrame.LookVector
elseif ForB < -.6 then
direction = hrp.CFrame.LookVector * -1
end
-- same goes for LorR, just change LookVector for RightVector
bv.Velocity = direction * power
bv.Parent = hrp
local duration = .2 -- change this
game.Debris:AddItem(bv, duration)