How do I establish a "connection" between a tile and its neighbours?

Let’s say I place a tower which “boosts” the neighbouring tiles so any tower i’ve placed or will place on the neighbouring tiles will have increased firepower. Do I use the tranform x,y where I add the corresponding -1/+1 to indicate the neighbouring tiles and add an “isBoosted” boolean? What if i don’t want to use the transform coordinates, any alternative better way?

Hi Slav,

Check the Pathfinder class. There is a little piece of code which checks the neighbouring waypoints. You could reuse it for your own idea.


See also:

Do you mean " Pathfinding Decisions" in the Realm Rush section?

Here is the link to Gary’s class.

I meant this line:

Vector2Int[] directions = { Vector2Int.right, Vector2Int.left, Vector2Int.up, Vector2Int.down };

Check how directions is used within the code.

1 Like

Thanks a lot!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms