Index Out of Range Error

Working through Moving Unit Through Pathfinding and suddenly started getting index out of range errors. Cannot seem to figure out what index is out of range.

I’m a moron. I was checking for a unit before I had removed invalid grid positions. So I was checking invalid positions for units which was causing the error.

1 Like

Yep. As a rule of thumb, it’s always best practice to ensure that any GridPosition you wish to act on is valid.

Not a moron, just human

2 Likes

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

Privacy & Terms