I want to have a drone that flies with WASD and QE to move down and up.
I have everything except the part where it changes the velocity of the drone.
if uis:IsKeyDown(Enum.KeyCode.W) then
module.Thrust = Vector3.new(0, 0, -1)
elseif uis:IsKeyDown(Enum.KeyCode.S) then
module.Thrust = Vector3.new(0, 0, 1)
else
module.Thrust = Vector3.new(0, 0, 0)
end
if uis:IsKeyDown(Enum.KeyCode.A) then
module.Thrust = Vector3.new(1, 0, module.Thrust.Z)
elseif uis:IsKeyDown(Enum.KeyCode.D) then
module.Thrust = Vector3.new(-1, 0, module.Thrust.Z)
else
module.Thrust = Vector3.new(0, 0, module.Thrust.Z)
end
if uis:IsKeyDown(Enum.KeyCode.Q) then
module.Thrust = Vector3.new(module.Thrust.X, -1, module.Thrust.Z)
elseif uis:IsKeyDown(Enum.KeyCode.E) then
module.Thrust = Vector3.new(module.Thrust.X, 1, module.Thrust.Z)
else
module.Thrust = Vector3.new(module.Thrust.X, 0, module.Thrust.Z)
end
module.Drone.Gyro.CFrame = CFrame.new(
module.Drone.Core.Position,mouse.Hit.p
)
local look = module.Drone.Core.CFrame.lookVector
module.Thrust = module.Thrust * module.Settings.Speed
module.Drone.Velocity.Velocity = Vector3.new(module.Thrust * look.X, module.Thrust.Y * look.Y, module.Thrust.Z * look.Z)