Search Unity

[WIP]Pixel perfect Pan and Zoom

Discussion in 'Works In Progress - Archive' started by Le_Tai, Mar 29, 2016.

  1. Le_Tai

    Le_Tai

    Joined:
    Jun 20, 2014
    Posts:
    442
    I need this in one of my project and I can't find one around the web so I decided to roll my own. It like the behavior you see in Class of Clan where the pixel you touch never leave your finger.

    The beauty of this method is that you don't have to set pan/zoom speed, it just work, on any screen resolution. It always zoom into the middle of your two fingers, and can pan and zoom at the same time. As you can see, I also make it work with mouse for fast testing.


    It only work with orthographic camera now but I'm planning on perspective soon, may be support spin.

    Oh, it also works with any camera angles.
     
    Last edited: Mar 30, 2016
    galvanizingarts and RavenOfCode like this.
  2. farshidhss

    farshidhss

    Joined:
    Apr 4, 2015
    Posts:
    8
    Are you using ray casting for this?