This is part two of 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.
For this post we’ll explore both zoom and rotation. The system can implement one or both of them, so they are not actually coupled in any way, but it makes much more sense to talk about them together than separately. To accomplish the two tasks we’ll be creating 3 new files – one that handles adjusting zoom, one that handles adjusting the rotation, and one that actually does the positioning of the camera.