Dash makes me float

What do you want to achieve?
I want to achieve were when I dash it will make me go down instead of float like this diagram:

What is the issue?
Here is the issue: The issue is my player floats when I dash but I want it to not make me float.

  1. What solutions have you tried so far?
    I don’t ant solutions as I’m pretty confused at how I can achieve this.

Here is my code for this if needed:

local Keybind = Enum.KeyCode.Q

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

local UIS = game:GetService("UserInputService")

local Debounce = false

local DashTime = .2
local Cooldown = 1
local Force = 50

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

UIS.InputBegan:Connect(function(Key)
	if Key.KeyCode == Keybind then
		if not Debounce then
			Debounce = true
			wait(Cooldown)
			
			local Slide = Instance.new("BodyVelocity")
			Slide.MaxForce = Vector3.new(1,1,1) * 20000
			Slide.Velocity = Humanoid.MoveDirection * Force
			Slide.Parent = Character.HumanoidRootPart
			
			-- Playing animation depending on the key held
			if UIS:IsKeyDown(Enum.KeyCode.W) then
				Anims.Forward:Play()
			elseif UIS:IsKeyDown(Enum.KeyCode.A) then
				Anims.Left:Play()
			elseif UIS:IsKeyDown(Enum.KeyCode.S) then
				Anims.Back:Play()
			elseif UIS:IsKeyDown(Enum.KeyCode.D) then
				Anims.Right:Play()
			end

			wait(DashTime)

			game.Debris:AddItem(Slide, 0.1)	
			
			Debounce = false
		end
	end
end)

1 Like

Try setting y axis to zero.

			Slide.MaxForce = Vector3.new(1,0,1) * 20000

2 Likes

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