[Unity] Generating a 'grid' of gameobjects on initialization

13lade619

is now a game developer :)
Reaction score
400
So i plan to code this pathfinding algorithm,
I've studied (here) what needs to be done like connecting 2 points and finding the most efficient path.

I'll implement a basic grid based pathfinding (not the complicated nav mesh stuff)
in Unity but first I need to generate a grid of nodes to perform the algorithm on.

Any tips on how to achieve this?

ie, I have the terrain and then on game initialization I create nodes on coordinates like (0,0) (0,1) (0,2) etc.
and then automatically input these nodes into the 2d array to perform the pathfinding on.
 

seph ir oth

Mod'n Dat News Jon
Reaction score
262
Your node class for each coordinate should have an Object variable. This object variable should be the parent for every kind of collidable object (your units, their units, terrain).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top