Search Unity

Update navmesh during runtime

Discussion in 'Navigation' started by Noxirus, Jun 19, 2020.

  1. Noxirus

    Noxirus

    Joined:
    Sep 18, 2019
    Posts:
    40
    Hello,

    I am trying to get something to happen in my game where the floor is removed and the navmesh will have to be updated (as there is no more floor so AI wont float). Problem is I am unsure how to go about updating the navmesh during runtime

    I tried using the BakeNavMesh function but it looks like it is just referencing the editor (so building is impossible as the editor will get compile errors as I am trying to access the editor in my scripts).

    I also tried adding a Navmesh obstacle to my floor with carving enable just moments before its removed but that does not seem to work either.

    Any ideas or help would be greatly appreciated!

    Thanks so much for your time and I hope you are all staying healthy and safe out there