How to make moving around fly system?

See I have a working flight system, but its really icky. The only way I thought of easily making it was using the mouse to point and fly in directions, but this isn’t my vision for what I wanted. I wanted a flight system that the player could control using WASD and freezes when the player isn’t using any of those keys. I’m not too versed in lookvectors, ect so I need some help with this if that could be provided! Thank you! Below is the code I’m using currently,

	local flightCooldown = false
	fire_curse:newAttack(Enum.KeyCode.J,function()
		if flightCooldown then return end
		
		print('flight')
		local speed = 50
		local extrakeybindcheck = "j"
		
		local uis = game:GetService("UserInputService")
		local char = plr.Character
		local hum = char:WaitForChild("Humanoid")
		local Torso = char:WaitForChild("UpperTorso")
		local Mouse = plr:GetMouse()
		local toggle = false
		
		Mouse.KeyDown:Connect(function(key)
			if key == extrakeybindcheck then
				if toggle == false then
					toggle = true
					local BV = Instance.new("BodyVelocity",Torso)
					BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
					while toggle == true do
						BV.Velocity = Mouse.Hit.lookVector*speed
						wait()
					end
					
				end
				if toggle == true then
					toggle = false
					Torso:FindFirstChildOfClass("BodyVelocity"):Destroy()
					for i, stoptracks in pairs(hum:GetPlayingAnimationTracks()) do
						stoptracks:Stop()
					end
				end
			end
		end)
	end)

Can you post a video of what it feels like currently?

2022-12-20 22-22-43 here it is, sorry for the long wait

It looks like there is no acceleration and the player is changing speed instantly. If you add acceleration it should feel a lot better. To make the player hover, what I would do is raycast straight down to see if the player is close to the ground, and if they are high enough, let them hover instead of dropping.

I mean thats not really my issue right now, fluidity isn’t my problem. My main questions is how I would implement a system that didn’t use the mouse, and the player would just move around using WASD and where their camera is facing. I haven’t really used raycasting nor lookvectors much and just took advice from a friend.

But these are really important things that you mentioned because it would for sure make it feel a ton better

The vector you are getting from the mouse can be replaced with a vector based on which WASD keys are pressed. You’ll probably want to get these relative to the camera, so that turning the camera and holding W is still effectively “mouse” controlled.

what would I type up for the vectors for like each key?

In the video the character moves based on the camera’s CFrame. The position change vector for each key would look like this:

-- Forward
camera.CFrame.LookVector * speed * deltaTime
-- Backward
-1 * camera.CFrame.LookVector * speed * deltaTime
-- Right
camera.CFrame.RightVector * speed * deltaTime
-- Left
-1 * camera.CFrame.RightVector * speed * deltaTime
-- Up (maybe E)
camera.CFrame.UpVector * speed * deltaTime
-- Down (maybe Q)
-1 * camera.CFrame.UpVector * speed * deltaTime

I believe you can anchor the character while they are flying then just add the vectors while the keys are pressed.