0

What i want is the following:

  • I got an object in the scene (which will never move)
  • With the onSwipe on Mobile the camera should rotate around the object
  • With Pinch (two finger zoom-in or zoom-out) I want to zoom in/out to the object in the scene

So I tried it with cinemachine and made this works with a mouse. But what can I do to made this work with mobile input.

Here are my settings in CineMachine: enter image description here

And my CameraController.cs:

        if (Input.GetMouseButtonDown(0) || Input.touches.Any(x => x.phase == TouchPhase.Began))// kinda works, but its laggie
    {
        freeLookComponent.m_XAxis.m_MaxSpeed = 500;
    }
    if (Input.GetMouseButtonUp(0) || Input.touches.Any(x => x.phase == TouchPhase.Ended))// kinda works, but its laggie
    {
        freeLookComponent.m_XAxis.m_MaxSpeed = 0;
    }

    if (Input.mouseScrollDelta.y != 0) //and touch???
    {
        freeLookComponent.m_YAxis.m_MaxSpeed = 50;
    }
Harrienak
  • 67
  • 9
  • Is your problem that you just want to detect if the player uses two fingers and zooms in and out? Did you get the swiping to work? What works with mobile so far? – gbe May 27 '21 at 19:37
  • The swiping (for rotating around the object) works, but it doesnt feel smooth. It kinda rotates the camera more then i would like with a short swipe. – Harrienak May 27 '21 at 19:43

0 Answers0