How to combine keyboard inputs

So I have a plane controlled with the keyboard. Q/E controls roll, A/D controls yaw, and W/S controls pitch. This is how the LocalScript looks as of now:

local input = game:GetService("UserInputService")

while true do
	wait()
	local av = plane.AngularVelocity.AngularVelocity
	
--PITCH
	
	if input:IsKeyDown(119) then
		plane.AngularVelocity.AngularVelocity = Vector3.new(
			0,
			0,
			0.05
		)
		plane.Orientation = plane.Orientation - av
	end
	if input:IsKeyDown(115) then
		plane.AngularVelocity.AngularVelocity = Vector3.new(
			0,
			0,
			0.05
		)
		plane.Orientation = av + plane.Orientation
	end
	
--YAW
	
	if input:IsKeyDown(97) then
		plane.AngularVelocity.AngularVelocity = Vector3.new(
			-0.05,
			0.05,
			0
		)
		plane.Orientation = av + plane.Orientation
	end
	if input:IsKeyDown(100) then
		plane.AngularVelocity.AngularVelocity = Vector3.new(
			-0.05,
			0.05,
			0
		)
		plane.Orientation = plane.Orientation - av
	end

--ROLL

if input:IsKeyDown(113) then
	plane.AngularVelocity.AngularVelocity = Vector3.new(
		0.05,
		0,
		0
	)
		plane.Orientation = plane.Orientation - av
end
if input:IsKeyDown(101) then
	plane.AngularVelocity.AngularVelocity = Vector3.new(
		0.05,
		0,
		0
	)
		plane.Orientation = av + plane.Orientation
	end
end

This controls the plane like it’s supposed to, but whenever I try to control multiple axes at once (for instance, pressing W to change pitch while pressing A to change yaw), the AngularVelocity values cancel each other out or something and the plane doesn’t turn at all.

How could I modify this script so that the values add onto one another and allow for multiple axes to be changed at the same time?

1 Like