Setting up the scene
We are going to set up a scene that looks like the following screenshot:
Let's follow a step-by-step procedure to do this:
- We create a directional light, the start and end game object, a few obstacle objects, a plane entity to be used as ground, and two empty game objects in which we put the
GridManager
andTestAStar
scripts. After this step, our scene hierarchy should be like this:
- We create a bunch of cube entities and add them to the Obstacles layer.
GridManager
looks for objects with this tag when it creates the grid world representation:
- We then create a cube entity and tag it as Start:
- Then, we create another cube entity...