This is the final part a multipart discussion of the camera system I have constructed for my experimental RTS game using Unity3d. In Unity3d RTS Camera Part 1: Data Component, I explained the DataComponent script that would be used to contain and provide all the data for the camera so that all the other components can share data easily. I highly suggest that you start there if you have not read it yet, as the Data Component is essential to the entire camera system. In Unity3d RTS Camera Part 2: Zoom and Rotate, I explained how we could use our Data Component to control zoom and rotation.
For this post we’ll explore the last remaining topic: panning, or scrolling, the camera. Only 1 new file need to be created for this final portion, but it contains the longest method we have seen so far, so there is a lot to go over. When we are through, we’ll have a functioning camera system that pans, zooms, and rotates, with a single script to control all of our data.