I want to make a swipe wherever you go, there and the camera. When I swipe, the camera is only half true. It rotates absolutely on all axes (it is overwhelmed). Can someone help?

using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class Swipe : MonoBehaviour, IDragHandler { Vector2 delta; Quaternion rotationX; Quaternion rotationY; Quaternion originRotation; public GameObject Camera; public void OnDrag(PointerEventData eventData) { delta = eventData.delta; rotationX = Quaternion.AngleAxis(delta.x, Vector3.up); rotationY = Quaternion.AngleAxis(-delta.y, Vector3.right); originRotation = Camera.transform.rotation; } private void FixedUpdate() { Camera.transform.rotation = originRotation * rotationY * rotationX ; } } 
  • I'm not special, but do not you yourself do not twist it on 2 axes? - tym32167
  • Yes, I need to turn on X (Left and Right) and Y (Up and Down), but it turns out when I twist on X, then it turns on and on Y from this turn. I somehow need to make a constant rotation so that X and Y are not dependent on each other - Artemka_naydanov

0