Tuesday, April 1, 2014

Isometric Style in Unity

Going ahead, adding few more projects in the list. The new part with this project is its isometric view. Yeah, all the assets are 2D. And we are placing them such that they look 3D. Well.. what else isometric projection gives ?



Isometric projection gives you perfect view to watch your 2D animated sprite in motion and giving you illusion of 3D. 
        So what I did for that ? Pretty much nothing.. :P. Some protocol you have to follow. Firstly ! Change your camera projection to Orthographic projection and then rotate the camera on X Axis and Y Axis by 45 Deg. Hence you got your camera showing isometric projection. 
         Now how to place your art with it ? Well good question, let me tell you the requirements of my game. I wanted to make something like Farmville or Hayday. User can put the buildings where ever he wants and then he has to upgrade them for the resource production. As the building upgrades its visuals and animation also changes. Hence giving the illusion of game progression.
        Secondly generate the platform and find out the position on platfrom where the user has clicked and place the gameobject(building) on it. The gameobject has two parts. The renderer and the collider and they are having relationship of parent and child with respect to each other.  Please keep in mind that you have to rotate the sprite in the correct orientation as well. 
    Now as for moving the buildings along a grid make a snapper function which holds the position of gameobject in real numbers only i.e: (1,0,4) or (12,12,10). Hence all the decimal values will filter out.
     I will be using NGUI plugin for keeping interactive buttons and pop up displays. This is all for now. Will post the further progress later.     
    

No comments:

Post a Comment