 Kent
|
What’s the best way to mark all nodes under the water plane as unwalkable? I’ve been thinking of:
1. Tried to get bounds to only include nodes with a certain y position, for use with UpdateGraphs, but it always includes the ground level nodes.
2. Change GridGenerator.cs to allow me to either modify nodes on creation or post-process the grid.
3. Loop over them after scan and modify setWalkability on every node where y < waterPlane.y and do a UpdateGraphs
I'm using a single GridGraph to cover an island surrounded by water.
|
 Kent
|
Update, this is what we did:
In Start(), a subclassed GraphUpdateObject runs Apply on every node to mark it as unwalkable if below the water level. It doesn’t show visibly until StartPath() is called though.
|
 Aron Granberg
|
Hi Kent
That’s a good method. It doesn’t show until StartPath is called because it will wait in a queue, or well, it does sometimes calculate directly, the logic behind it is a bit complicated. I will always be done before the next path is calculated anyway.
|