userInputService.InputChanged:connect(function(g,r)if g.KeyCode==Enum.KeyCode.Thumbstick1 then if g.Position.magnitude>=gamepadDeadzone then movement=Vector2.new(movement.X,g.Position.Y)else movement=Vector2.new(movement.X,0)end elseif g.KeyCode==Enum.KeyCode.Thumbstick2 then if g.Position.magnitude>=gamepadDeadzone then movement=Vector2.new(g.Position.X,movement.Y)else movement=Vector2.new(0,movement.Y)end end end)

userInputService.InputChanged:connect(function(inputObject, gameProcessedEvent)
	--if not gameProcessedEvent then
		if inputObject.KeyCode == Enum.KeyCode.Thumbstick1 then
			if inputObject.Position.magnitude >= gamepadDeadzone then
				movement = Vector2.new(movement.X, inputObject.Position.Y)
			else
				movement = Vector2.new(movement.X, 0)
			end
		elseif inputObject.KeyCode == Enum.KeyCode.Thumbstick2 then
			if inputObject.Position.magnitude >= gamepadDeadzone then
				movement = Vector2.new(inputObject.Position.X, movement.Y)
			else
				movement = Vector2.new(0, movement.Y)
			end
		end
	--end
end)
