Moving camera does not work in first person on mobile

I have this first-person system for my game. It works perfectly fine on PC, but does not you move your camera on mobile. I use this function to allow camera rotation on PC, how would i make it so it works for mobile aswell?

input.InputChanged:connect(function(inputObject)
	if not running then return end
	if FirstPerson then
		if inputObject.UserInputType == Enum.UserInputType.MouseMovement then
			
			
		local delta = Vector2.new(inputObject.Delta.x/Sensitivity,inputObject.Delta.y/Sensitivity) * Smoothness

		local X = TargetAngleX - delta.y 
		TargetAngleX = (X >= 80 and 80) or (X <= -80 and -80) or X 
			TargetAngleY = (TargetAngleY - delta.x) %360 
			end
	end	
	
end)
1 Like

You can use UserInputService.TouchMoved to achieve this, it has simillar properties to MouseMovement

2 Likes

Thank you so much! It works now.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.