The ultimate isometric toolkit offers a pathfinding solution. It is currently still under development and not polished.
Adding Pathfinding to your Project#
Pathfinding is implemented using the A* algorithm which operates on a graph. You can extend pathfinding by implementing your own Graph or use the GridGraph component that comes with it.
Create a new empty GameObject and add the
The GridGraph discretizes the entire ismetric space into cells of 1x1 blocks. It then goes over all
IsoTransforms in the scene and creates a negative to create the 'walkable' area.
ScanheightThe maximum height in isometric space to be taken into account when creating the graph
Show GraphEnables/Disables Editor debugging
IgnorablesA list of IsoTransforms to be ignored when constructing the 'walkable' area. Add your AstarAgent, NPCs, tiny objects, etc.
The Graph will be updated once on
void Awake(). To highlight the graph in the editor press 'Upate Graph' in the inspector window of the GridGraph component
Adding the Astar Agent#
Agents are responsible to find path from a to b.
- Add the
AstarAgentcomponent to any of your character sprites.
- Add the character to the Ignorables list of your
- Reference the
GridGraphto the AstarAgent in the inspector window
- To invoke pathfinding call
AstarAgent.MoveTo(Vector3 destination)from any other script.
JumpHeightThe maximum allowed distance on the y axis to travel between to adjacent nodes.
SpeedThe Speed in units per second
GraphThe Graph to operate on
HeuristicThe A* heuristic to use when searching for a path, euclidian is what you will use in most cases
AStarTestScript shows how to invoke pathfinding for an AstarAgent using raycasting.
AStarTestScript uses raycasting to find the input position and requires colliders on all IsoTransform of your scenery.