Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Any easy way to pan/zoom the UI along with the camera?

Discussion in 'UGUI & TextMesh Pro' started by JoeStrout, Feb 17, 2021.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I'm working on a mobile version of my game, and I need the ability to zoom and pan with two fingers. That's easy enough to do for the main camera, by adjusting the camera position and orthographicSize. But it doesn't affect the UI, even though the Canvas is set to Screen Space - Camera.

    I want this:
    upload_2021-2-17_7-36-2.png

    But instead I'm getting this (note the unzoomed frame, which is drawn by the Canvas):
    upload_2021-2-17_7-35-12.png

    Is there any easy trick to make the canvas stick with the camera?