When jump and dash my character float

So when i jump and press q my character dash but float


i use LinearVelocity

local animtable = {
	run = Humanoid:WaitForChild("Animator"):LoadAnimation(ReplicatedStorage.Animations.Movement.Run),
	ForwadDash = Humanoid:WaitForChild("Animator")
		:LoadAnimation(ReplicatedStorage.Animations.Movement:WaitForChild("Foward Dash")),
	BackDash = Humanoid:WaitForChild("Animator"):LoadAnimation(ReplicatedStorage.Animations.Movement.BackDash),
	LeftDash = Humanoid:WaitForChild("Animator"):LoadAnimation(ReplicatedStorage.Animations.Movement.LeftDash),
	RightDash = Humanoid:WaitForChild("Animator"):LoadAnimation(ReplicatedStorage.Animations.Movement.RightDash),
}
local function DeadMove()
	Humanoid.WalkSpeed = 0
	Humanoid.UseJumpPower = true
	Humanoid.JumpPower = 0
end
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.UserInputType == Enum.UserInputType.Keyboard and not gameProcessedEvent then
		if input.KeyCode == Enum.KeyCode.Q and cooldown == false then
			cooldown = true
			local attachment = Instance.new("Attachment", Character:FindFirstChild("HumanoidRootPart"))
			local linearvelocity = Instance.new("LinearVelocity", Character:FindFirstChild("HumanoidRootPart"))
			linearvelocity.MaxForce = 10000
			linearvelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
			linearvelocity.Attachment0 = attachment
			linearvelocity.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
			attachment.WorldPosition = Character:FindFirstChild("HumanoidRootPart").AssemblyCenterOfMass
			if UserInputService:IsKeyDown(Enum.KeyCode.W) then
				IsDashing.Value = true
				DeadMove()
				animtable.ForwadDash:Play()
				linearvelocity.VectorVelocity = Vector3.new(0, 0, -40)
				animtable.ForwadDash.Stopped:Wait()
				IsDashing.Value = false
				if isrunning.Value and Humanoid.MoveDirection.Magnitude > 0 then
					BackRunning.Value = true
				end
			elseif UserInputService:IsKeyDown(Enum.KeyCode.S) then
				IsDashing.Value = true
				DeadMove()
				animtable.BackDash:Play()
				linearvelocity.VectorVelocity = Vector3.new(0, 0, 30)
				animtable.BackDash.Stopped:Wait()
				IsDashing.Value = false
				if isrunning.Value and Humanoid.MoveDirection.Magnitude > 0 then
					BackRunning.Value = true
				end
			elseif UserInputService:IsKeyDown(Enum.KeyCode.A) then
				IsDashing.Value = true
				DeadMove()
				animtable.RightDash:Play()
				linearvelocity.VectorVelocity = Vector3.new(-50, 0, 0)
				animtable.RightDash.Stopped:Wait()
				IsDashing.Value = false
				if isrunning.Value and Humanoid.MoveDirection.Magnitude > 0 then
					BackRunning.Value = true
				end
			elseif UserInputService:IsKeyDown(Enum.KeyCode.D) then
				IsDashing.Value = true
				DeadMove()
				animtable.LeftDash:Play()
				linearvelocity.VectorVelocity = Vector3.new(50, 0, 0)
				animtable.LeftDash.Stopped:Wait()
				IsDashing.Value = false
				if isrunning.Value and Humanoid.MoveDirection.Magnitude > 0 then
					BackRunning.Value = true
				end
			else
				IsDashing.Value = true
				DeadMove()
				animtable.BackDash:Play()
				linearvelocity.VectorVelocity = Vector3.new(0, 0, 30)
				animtable.BackDash.Stopped:Wait()
				IsDashing.Value = false
				if isrunning.Value and Humanoid.MoveDirection.Magnitude > 0 then
					BackRunning.Value = true
				end
			end

1 Like

You could try making the linear velocity have a much higher speed boost but only last like 0.1-0.15 seconds. That reduces air time a lot but can still maintain the same distance.

2 Likes

how would you do it?, in the script

1 Like

Try decreasing the max force each playtest until you get the result you want. Less force may make gravity take more effect when the force gets weaker.

1 Like

if derecreasing the max force when i jump and dash the character fall but when i,m in the floor dont move and jump and dash y very slow

1 Like

Iā€™m not exactly sure how linear velocity works compared to the others (I have only used others), but where is the value in your script where it makes the velocity last that long then stops? If there is one, I was just suggesting making that last like 0.1 seconds instead of 0.5 and making the velocity of the direction you want to go something like 150 instead of 50 since that would reduce air time.

if i set in 150 only get the dash is longer i need when i jump and dash the user fall with dash