What would cause GetNearest() to return null?

For some reason when using MapMagic, I cannot run on my terrain. If I use a fixed terrain I had previously it works just fine. I’ve narrowed it down to GetNereast() returning null GraphNodes. I’ve tried adding in Scan() calls if null is returned but it has not helped.

Any ideas?

In digging into this more it seems it has something to do with range. My MM landscape is not near the player apparently on startup. Even though I move the player to the right spot in run mode, and re-scan, it still returns null. Is there a call I should be making to “initialize” a-star after I have moved the player to the right spot?

Hi

GetNearest has a distance limit set by A* Inspector -> Settings -> Max Nearest Node Distance. Maybe it is this limit that you are running into?

That seemed to fix it… The problem I was having is that the terrain is “high” with a Y of 160. The max was set to 100. That kept a-star from seeing the area.

1 Like