GraphUpdate with interiors

I have a grid graph and want to define zones that have an interior and a border zone. Specifically: Areas with a fence around. The fence should be one tag (so nothing crosses through it) while the interior should be a different tag (so animals know where they should be).

I can’t seem to get this right. It appears that the execution order of two GraphUpdates is not fixed, so sometimes the interior doesn’t get set properly.

What am I doing wrong?

To illustrate, this is what I want:
interior
red (edge/border/fence) has one tag, green (inside) has another.

I have tried having two GraphUpdate components that overlap each other, i.e. the red one is larger than the green one. But it seems that sometimes the green one is calculated first and then I end up with only the red one.

I do need tags, I can’t simply set the red to not walkable (I have some NPCs that can jump over or walk through the fence).

Hi

First, make sure guo.updatePhysics is set to false if you only want to update the tags.

Make sure that the red zone runs first, and then the green zone.

Is there a way to control execution order aside from enabling the components in a set order (that would required quite a bit of additional coding as all this stuff is dynamically generated and placed in my game).

Hi

Sorry, there’s currently no built-in way to set the order of graphUpdateScene components, I’m afraid.

Just for someone who might find this in the future: After some experimenting, I went to having non-overlapping zones, so instead of 2 gameobjects where one area contains the other, I now have 5, one for the center and 4 for the sides tracing the wall/fence. This works reliably for me.

1 Like