- Home /
2D Isometric Game Setup
Hi all,
I have just started using Unity and have a couple of questions about 2D isometric game setup. The game contains an isometric grid, assets will snap to the grid cells. Pretty standard.
I have two cameras:
Camera 1 is for showing assets in flat 2D world. It is top-down orthographic with no rotation or transformations.
Camera 2 is for tracking mouse movement on the grid. To do this, I set up an empty game object with isometric transformations (using: http://answers.unity3d.com/questions/12027/how-to-do-a-camera-that-is-top-downisometric.html). Inside the container game object is a camera and a plane used as the isometric grid. The camera culling mask is set to only show the grid. Attaching a mouse handler script to the plane allows me to easily track when the mouse is over the grid.
Does this seem like a good way to do the isometric grid mouse interaction (e.g. to tell if the mouse is over the grid or not)?
Also, when converting the mouse position on the grid from screen to local with:
mousePositionWorld = Camera.main.ScreenToWorldPoint(Input.mousePosition);
localPoint = Camera.main.transform.InverseTransformPoint(mousePositionWorld);
the origin (0,0) of the grid is in its center. Is there an easy way to make the origin the top left or bottom left of the grid?
Thanks in advance.