Create an empty project and import the Ultimate Isometric Toolkit asset.
Isometric Coordinate System#
The toolkit uses a differnt coordinate system (left) to create the isometric effect.
To convert a given Vector3 v from the isometric coordinate system (left) to unity's coordinate (right) system we use
Vector3 vectorInUnitySpace = Isometric.IsoToUnitySpace(v);
Vector3 vectorInIsometricSpace = Isometric.UnityToIsoSpace(v);
The IsoSorting component#
- Add a new empty GameObject to the scene
- Add the IsoSorting component to it
- Then add the Tiled Sorting component and drag it onto the Sorting Strategy field in the inspector window.
The IsoSorting component is the key component of every isometric scene. It is responsible for sorting all sprites at runtime to create the isometric 2.5d effect.
There are multiple ways on how to achieve proper isometric sorting called Sorting strategies. The isometric toolkit offers three sorting strategies right now. For the most part you would choose the Tiled Sorting approach.
The IsoTransform Component#
Drag a sprite into the scene and add the IsoTransform component to it.
IsoTransforms extend the regular Transform component similar to the RectTransform component. The IsoTransform component replaces the Transform component in the inspector window. IsoTransforms hold the position and size in isometric space.
For ease of use all sprites have properly set up prefabs in their respective Prefabs folder that you can add to the scene.
Bring up the IsoSnapping utility tool by pressing CTRL+L. The IsoSnapping tool allows you to evenly place IsoTransforms in your scene.
- Auto Snap when active IsoTransform will be automatically put to the closest multiple of Snap Value
- Snap Value IsoTransforms will snap to the closest multiple of x, y, z
- Snap Selection Snaps the current selection in the hierarchy
If you are familiar with Unity there is not much to say about this but let me walk you through the basics anyways. Under AddComponent/UIT/Physics you can find all physics components like IsoRigidbodies and IsoColliders for the primitive types.
In order to collide with objects, to detect a raycast or mouse/touch inputs you have to add an IsoCollider. To add forces like gravity you need to add an IsoRigidbody. You can implement custom MonoBehaviour scripts for the OnIsoCollisionEnter/Exit/Stay, OnIsoTriggerEnter/Exit/Stay, and OnMouseEnter/Exit/Over/Down/Up callbacks. The IsoPhysics class offers functions for raycasting. Take a look at the test scripts under Scripts/Test to see exemplary implementations.
That should be all you need to know to get started with your isometric project in Unity.