How could I disable jumping while dashing?

So, I just finished my dash system and then when I test it, I see that there’s a little problem. Whenever I jump while dashing It just feels really off for me and also it bugs…

Here is a video to show u what I mean :

I tried making the

Humanoid.JumpPower = 0

and then after the dash is finished make it to 50 but For some reason It doesn’t change when I dash.

Try setting the JumpPower back to 50 once the animation is not being played.

Here is a basic way of it.

local Humanoid = script.Parent.Humanoid
local Animation = Humanoid:LoadAnimation(script.Animation)

Animation:GetPropertyChangedSignal("Playing"):Connect(function()
    if not Animation.Playing then
        Humanoid.JumpPower = 50
    else
        Humanoid.JumpPower = 0
    end
end)

I tried it but it didn’t work here is my script so you can see more clearly :

local UIS = game:GetService("UserInputService")
local rp = game:GetService("ReplicatedStorage")
local ts = game:GetService("TweenService")

local dashEvent = rp.Movement.Events:WaitForChild("Dash")

local fx = rp.Movement:WaitForChild("Fx")

local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")

local camera = workspace.CurrentCamera

local dashes = {
	front = Humanoid:LoadAnimation(script:WaitForChild("RollFront")),
	left = Humanoid:LoadAnimation(script:WaitForChild("LeftRoll")),
	back = Humanoid:LoadAnimation(script:WaitForChild("BackRoll")),
	right = Humanoid:LoadAnimation(script:WaitForChild("RightRoll")),
}

local dashCooldown = 2
local dashTime = .3
local canDash = true

UIS.InputBegan:Connect(function(input, Typing)
	if input.KeyCode == Enum.KeyCode.Q and canDash then
		if UIS:IsKeyDown(Enum.KeyCode.W) then
			Humanoid.JumpPower = 0
			canDash = false
			local Attachment = Instance.new("Attachment", Character:WaitForChild("HumanoidRootPart")) 
			local dash = dashes.front
			dash:Play()
			local LV = Instance.new("LinearVelocity", Attachment)
			LV.MaxForce = math.huge
			LV.VectorVelocity = Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 50
			LV.Attachment0 = Attachment
			game.Debris:AddItem(LV, dashTime)
			dashEvent:FireServer(Character, LV.VectorVelocity, dashTime)
			wait(dashCooldown)
			canDash = true
		elseif UIS:IsKeyDown(Enum.KeyCode.A) then
			canDash = false
			local Attachment = Instance.new("Attachment", Character:WaitForChild("HumanoidRootPart")) 
			local dash = dashes.left
			dash:Play()
			local LV = Instance.new("LinearVelocity", Attachment)
			LV.MaxForce = math.huge
			LV.VectorVelocity = -Character:WaitForChild("HumanoidRootPart").CFrame.RightVector * 50
			LV.Attachment0 = Attachment
			game.Debris:AddItem(LV, dashTime)
			dashEvent:FireServer(Character, LV.VectorVelocity, dashTime)
			wait(dashCooldown)
			canDash = true
		elseif UIS:IsKeyDown(Enum.KeyCode.S) then
			canDash = false
			local Attachment = Instance.new("Attachment", Character:WaitForChild("HumanoidRootPart")) 
			local dash = dashes.back
			dash:Play()
			local LV = Instance.new("LinearVelocity", Attachment)
			LV.MaxForce = math.huge
			LV.VectorVelocity = -Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 50
			LV.Attachment0 = Attachment
			game.Debris:AddItem(LV, dashTime)
			dashEvent:FireServer(Character, LV.VectorVelocity, dashTime)
			wait(dashCooldown)
			canDash = true
		elseif UIS:IsKeyDown(Enum.KeyCode.D) then
			canDash = false
			local Attachment = Instance.new("Attachment", Character:WaitForChild("HumanoidRootPart")) 
			local dash = dashes.right
			dash:Play()
			local LV = Instance.new("LinearVelocity", Attachment)
			LV.MaxForce = math.huge
			LV.VectorVelocity = Character:WaitForChild("HumanoidRootPart").CFrame.RightVector * 50
			LV.Attachment0 = Attachment
			game.Debris:AddItem(LV, dashTime)
			dashEvent:FireServer(Character, LV.VectorVelocity, dashTime)
			wait(dashCooldown)
			canDash = true
		end
	end
end)

okay, I just saw the problem and it’s really dumb. I had a script that would change the jump power and I had forgot.

1 Like

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