Controller support for custom camera [SOLVED]

I want to add controller support to my over the shoulder camera system. So I watched a YouTube tutorial on how to make a over the shoulder camera system which works perfectly fine. I want to add controller support to my game but I can’t seem to figure out how to do it. So far this is the code I’ve come up with:

ContextActionService:BindAction("CameraMovement", function(ActionName, InputState, InputObject)
		if (InputObject.UserInputType ~= Enum.UserInputType.Gamepad1) then
			
			xAngle = xAngle - InputObject.Delta.x * 0.4
			yAngle = math.clamp(yAngle - InputObject.Delta.y * 0.4, -75, 75)
			
		elseif (InputObject.UserInputType == Enum.UserInputType.Gamepad1) and (InputObject.KeyCode == Enum.KeyCode.Thumbstick2) then
			
			if (InputObject.Position.Magnitude > 0.15) then
				
				xAngle = -(InputObject.Position.X * 20)
				yAngle = (InputObject.Position.Y * 15)
				
			end
			
		end
	end, false, Enum.UserInputType.MouseMovement, Enum.UserInputType.Gamepad1)

However this is the result when using a Gamepad:

https://gyazo.com/4a3eb976e36d8276827deaa6cd38a821

As you can see I can’t really move my camera past a certain position? If you need to see more of the code I am happy to post it. Thank you

1 Like

Anyone help please I’m still trying to understand how to get controller support ?