Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Making a Orthographic Camera that Tracks Multiple Targets (Blog post / tutorial)

Discussion in 'Scripting' started by RyanNielson, Mar 30, 2014.

  1. RyanNielson

    RyanNielson

    Joined:
    May 23, 2013
    Posts:
    24
    * Removed the link and moved to the correct forum. Can't delete post since there's no button, sorry!
    Hey everyone,



    I recently began working on a new top-down 2D local multiplayer game. One of my first goals was to get a decent camera system that would work well for a local game. My main goals were dynamic zooming to fit all players on screen, centering on all players, and supporting many targets simultaneously.

    I managed to come up with a pretty simple orthographic camera system that seems to work pretty well and accomplish all these tasks. Like I said it's simple, but it seems to work quite well. I couldn't find any similar systems, so I figured I'd release the code and do a quick write-up explaning how it works. This may even be easy to adapt to a perspective camera, but I haven't tried that yet.

    Since it's a moderately long post, I'm just going to provide a link to it. I'm hoping many of you find it useful, and you may even have ways to improve it. If you do feel free to post here or on the blog post itself. I'm happy to listen to any feedback.

    Enjoy!
     
    Last edited: Mar 30, 2014