How to bake/update NavMesh at Runtime in Unity

Опубликовано: 29 Сентябрь 2024
на канале: iwanMods
46,014
470

0:00 Intro
0:10 Awkwardly install the package
0:54 Add 2 cubes to test NavMeshes
1:20 Copy runtime baking code
2:00 Attach script to an object
2:43 Add NavMeshSurface components
2:58 Set up Navigation Baker script
3:19 Fix RunTimeNavMeshBuilder: Source mesh Combined Mesh (root: scene) 2 does not allow read access.
3:55 Does it work in Update() too?
4:18 Cleanup
4:48 Testing seperate islands
4:56 Fix errors again
6:56 Test: manually change scene during runtime

git URL to add: https://github.com/Unity-Technologies...

code for NavigationBaker.cs : https://gist.githubusercontent.com/iw...

If this video is overwhelming, start with    • Get started with Navmeshes in Unity i...  

Next step would be to go through    • Runtime NavMesh Generation - Introduc...  

If you're curious - I keep the errors in because I expect people to also run into them, so they can see how I fixed (avoided) them