Search Unity

Question RunTime Modifications On Surface Area

Discussion in 'Navigation' started by frizoqpa, Apr 11, 2023.

  1. frizoqpa

    frizoqpa

    Joined:
    Feb 27, 2022
    Posts:
    1
    Hey!
    In my game you pay money to unlock new pieces of land. I can't rebake the whole NavMesh map everytime a land unlocked.
    I tried to assign "lockedArea" to lands which is locked, "unlockedArea" to ones unlocked.
    I unchecked lockedArea from my agent's area mask so agent couldn't go there. It works okay.

    But here is the problem: when i unlock a new land i change land's area to "unlockedArea" via the NavMeshModifier from code, but agent still assume it is locked.

    I can't rebake the map over and over again since it is a mobile game and it causes huge fps drops.

    So i need to update the navmeshdata somehow. I would appreciate any help!