Problem with momentum system mid air - cant change direction the player is flying into

ive been trying to make a system to make players keep momentum mid air (im making a parkour game inpired by beatrun and mirrors edge), ive pretty much got a good system but i cant change the direction the player flies into, making it extremely unresponsive

heres the script

game:GetService("RunService").Heartbeat:Connect(function()
	if script.Parent.Humanoid.FloorMaterial==Enum.Material.Air then
		local y = velocity.Y - 2.5
		velocity = Vector3.new(velocity.X, y, velocity.Z)
		script.Parent.HumanoidRootPart.Velocity = velocity
	end
	velocity = script.Parent.HumanoidRootPart.Velocity
end)
1 Like