Friday, February 28, 2014

Coordinates in the game.

There are two coordinate systems in this game.


  • Unity's built-in 3d coordinates which uses left-hand coordinate system. using Vector3 class.
  • 2D screen tile-based coordinate system. using VectorInt2 class.
The problem is that the Y-axis is reversed between these two. Be aware of that.

Use Level.WorldToGrid(Vector2) to translate the first to the second.

No comments:

Post a Comment