Jarret.Byrne

Politics, Sociology, Firefighting, Technology, and Original Fiction

Category: Unity3d

Unity3d RTS Camera Part 3: Panning

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.

Read More

Unity3d RTS Camera Part 2: Zoom and Rotate

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.

Read More

Unity3d RTS Camera Part 1: Data Component

This is part one of a multipart discussion of the camera system I have constructed for my experimental RTS game using Unity3d. We begin with building a class to house all of the data for the camera that all of the various parts of the system – zoom, rotation, panning – will need to share or impact. By separating out the data from the classes that consume them, we gain some logical division, and the centralization allows for greater control. There is also a certain degree of cleanliness to the system as well, as it helps to cut down on bugs when our operations are essentially “dumb”, and there is one data class that can be “smart” for all of them equally.

Read More

Powered by WordPress & Theme by Anders Norén