Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to use CinemachineFreeLook camera pinch to zoom in moblie?

Discussion in 'Cinemachine' started by wsxc9468, Dec 19, 2020.

  1. wsxc9468

    wsxc9468

    Joined:
    Dec 19, 2020
    Posts:
    1
    Hello
    I'm having a hard time zooming out with two fingers of the Cine Machine camera on the quarter view screen while making the Mobile RPG game. It would be really helpful if you could provide us with some data or examples to refer to. Thank you.
     
    hadinaufal likes this.
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Hi,

    If you are having trouble setting up touch input, then have a look at this forum thread:
    https://forum.unity.com/threads/cinemachine-touch-input.1010227/

    If you have the input system set up, but having trouble controlling the zoom of the camera, then:
    • Could you send a pictures of your vcams with which you'd like to zoom? or
    • The names of these vcam's Body and Aim components?
     
  3. Chris9465

    Chris9465

    Joined:
    Nov 3, 2020
    Posts:
    21
    I've been working on this issue and have gotten to the point of copying and rewriting the Cinemachine Input Provider to differentiate the X from the Y axis. (Note I have mouse input actions here because I can't use touch controls in the editor) upload_2022-1-7_13-38-18.png

    Now I need to get the pinch zoom functionality added using the new Input System if possible and then pass that functionality through this script to the cinemachine freelook cam
     
  4. Chris9465

    Chris9465

    Joined:
    Nov 3, 2020
    Posts:
    21
    Following up, I'm now able to turn on and off the Y Axis in my script with a bool and using the new InputSystem events :)
    upload_2022-1-7_14-25-6.png
     
  5. Chris9465

    Chris9465

    Joined:
    Nov 3, 2020
    Posts:
    21
    The ZoomConditionActionReference is another InputActionReference. On mouse/keyboard it is set as the spacebar. On mobile it will be listening for the second finger to be touched down

    upload_2022-1-7_14-26-10.png