How to make the player dash in their moving direction

I’m trying to make a dash system. You can dash in your moving direction and every direction has its own animation.

Here is the script I have right now:

local Keybind = Enum.KeyCode.Q

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Animator = Humanoid:WaitForChild("Animator")

local UIS = game:GetService("UserInputService")

local DashTime = .2
local Force = 70

local Anims = {
	["Left"] = Animator:LoadAnimation(script.Animations:WaitForChild("Left")),
	["Right"] = Animator:LoadAnimation(script.Animations:WaitForChild("Right")),
	["Foward"] = Animator:LoadAnimation(script.Animations:WaitForChild("Forward")),
	["Back"] = Animator:LoadAnimation(script.Animations:WaitForChild("Back"))

	if Key.KeyCode == Keybind then

		local Slide ="BodyVelocity")
		Slide.MaxForce =,0,1) * 30000
		Slide.Velocity = Humanoid.MoveDirection * Force
		Slide.Parent = Character.HumanoidRootPart


		game.Debris:AddItem(Slide, 0.1)
		for count = 1, 2 do
			Slide.Velocity *= 0.3


I found out how to create the dash, however i dont know how i would implement the animations.

1 Like

You could detect if player is pressing WASD keys by using bool values (true/false) and bind detection. To do this, you may need to create InputBegan functions and connect them to WASD keys, if some of these keys are being pressed then you can set their bool values to true or if they being released set them to false. In the main function you can check if WASD’s bool values are true and you can play an animation if they’re true.
I may explained it bad but i cant do anything with it.