#how to make a dash system for mobile?

1 messages · Page 1 of 1 (latest)

tranquil plaza
#
MobileGUI.MobileFrame.DashButton.MouseButton1Click:Connect(function()
    local movedirection=HRP.CFrame:VectorToObjectSpace(hum.MoveDirection)
    local yDirection=math.atan2(movedirection.X,movedirection.Z)
    local roundDirection=math.ceil(math.deg(yDirection)-0.5)
    print(roundDirection)
    if roundDirection>0 and roundDirection<=180 or roundDirection==0 and roundDirection<=180 then
        Dash:FireServer("FrontDash", 1)
    elseif roundDirection<0 and roundDirection<=-180 then
        Dash:FireServer("BackDash", 1)
    elseif hum.MoveDirection==Vector3.new(-1,0,0) then
        Dash:FireServer("LeftDash", 2)
    elseif hum.MoveDirection==Vector3.new(1,0,0) then
        Dash:FireServer("RightDash", 2)
    end
end)
#

i just copied the math and thats it

#

ive seen devforum posts get -45 and struff but i just get like -0 or 180 or -180 and the same