Move the camera using a thumbstick for VR

Hello!

  1. What do you want to achieve? I want to make it so I can use my VR controllers to move my VR character around by moving the camera.

  2. What is the issue? I do not comprehend CFrames, so you can move, but all the controls are reversed and I cannot move outside of a certain radius of where I started at.

  3. What solutions have you tried so far? I don’t know where to look but I’ve tried a bunch of CFrame stuff and I don’t know how to fix it.

Here’s my camera movement code (yes i know it has headscale in there, try not to change that):

local UserInputService = game:GetService("UserInputService")
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.HeadScale = 4.5

local function OnInputChanged(Input, GameProcessedEvent)
	if Input.KeyCode == Enum.KeyCode.Thumbstick1 then
		local position = Input.Position
		
		--CFRAME
		local coordframe = CFrame.new(camera.CFrame.Position,camera.CFrame.Position + Vector3.new(position.X, 0, -position.Y))
		print(coordframe)
		camera.CFrame = camera.CFrame + coordframe
		camera.Focus = camera.CFrame
	end
end

UserInputService.InputChanged:Connect(OnInputChanged)

Thanks!