-- Initialize client-side control of the aircraft

function Init()	
	guiController:Start(speeder)
	engine.Throttle = 0
	
	-- Setup boost
	maxBoostAmount = engine._settings.BoostAmount
	boostAmount = engine._settings.BoostAmount
	
	if IS_MOBILE then
		-- Hide mobile controls
		UserInputService.ModalEnabled = true
	end
	
	-- If on PC (not console nor mobile)
	if (not IS_MOBILE and not IS_CONSOLE) then
		guiController:SetUsingGamepad(Gamepad.IsConnected)
		Gamepad.Connected:Connect(function()
			guiController:SetUsingGamepad(true)
			GetInput = GetGamepadInput
		end)
		Gamepad.Disconnected:Connect(function()
			guiController:SetUsingGamepad(false)
			GetInput = GetKeyboardInput
		end)
	end
	
	-- Input function
	if IS_CONSOLE then
		GetInput = GetGamepadInput
	elseif IS_MOBILE then
		GetInput = GetMobileInput
	else
		GetInput = (Gamepad.IsConnected and GetGamepadInput or GetKeyboardInput)
	end
	
	-- Start listeners for RenderUpdate and Heartbeat
	physicsUpdateHandle = RunService.Heartbeat:Connect(PhysicsUpdate)
	humanoid.Died:Connect(function() dead = true end)
end -- Init()