I'm extremely new to game creation.
I'm playing around with creating a 2D Unity game. The scene is setup from the default Unity 5 2D template. Following a tutorial, I've created a TerrainManager GameObject and Script. The script instantiates tiles and sets their position using a standard double-loop.
I've found a 2D isometric tile set.
Each tile is visually rendered as rotated around the vertical axis by 45 degrees, creating more of a diamond shape rather than a square. This requires that every second tile be offset by half the tile width on the x-axis, and half the tile height on the y-axis.
As each tile is of a different height, one can not simply offset the tile on the Y axis by half its height. Each terrain "layer" is 16px tall in the PNG. Some PNGs have a single "layer", some have multiple "layers". (For instance, a single layer water tile is 83px in height, while a dual layer "grass on top of dirt" layer is 99px in height.
As the game object expects the
transform.position as a
Vector3 in (I assume) game units, I do not know how to compose this using pixel values.
So the question I have is, how do I achieve the 16px y-axis offset of the game object?
I'm more than happy to provide additional details if needed.