- A* version: 5.3.3
- Unity version: 2022.3.60f1
Hi, I’m using a recast graph for pretty dynamic world. By dynamic world I mean that player can change it in any second: remove some blocks, add some blocks, place water and so on.
The problem is the following:
- When player places water in the world, I’m changing the tag of the graph for water surface, this tag plays the role of penalty for seekers [Each seeker(NPC) is set up in such a way that the water tag is treated as penalty area, so NPCs avoid water but if they ended up in water they can navigate through it]. So far so good. By the way, I’m not updating physics on this step, just getting nearest graph nodes to water and changing their tags
- When player places blocks above water [I do update physics for these blocks, to allow NPC to climb on them] the water surface graph updates with the blocks’ surface graph, meaning that penalty tag for water becomes the same as for blocks [no penalty], and the graph surface of water changes it physics although they are on different heights [graph surface of water and graph surface of blocks]. ← This is the problem
Expected behavior:
Graph surfaces of water and graph surface of blocks that are placed above water are fully decoupled and do not influence each other.
Additional details:
GraphUpdateObject is used for recast graph updates