- Home /
NavMeshSurface at runtime - agent not on surface?
Tried generating navmeshsurface at runtime using the tutorial script https://unity3d.com/learn/tutorials/topics/navigation/baking-navmesh-runtime
Warped agent to mesh position. SetDestination never seems to work?
"SetDestination" can only be called on an active agent that has
Sanity check: baking navmesh in editor works, just not at runtime/play mode.
we need more info, we need to see your agent settings, we need to see your surface, we need to know whether if you use height map or not. just provide screenshots, with steps you have already tried. you know, you can not get magic word that works for you without providing info.
Answer by adriant · Dec 27, 2017 at 10:33 AM
Try to disable the NavMeshAgent, move it near the NavMesh and then enable it again. It should then work to call SetDestination.
Answer by PNUMIA-Rob · Mar 30, 2018 at 06:37 PM
Download the High Level NavMesh Building Components (https://docs.unity3d.com/Manual/NavMesh-BuildingComponents.html) available for download on GitHub at https://github.com/Unity-Technologies/NavMeshComponents/archive/master.zip and install them into your project. From there use a NavMeshSurface to create your NavMeshes (yes that's plural) at runtime. A pretty thorough overview of this is given by Mike Geig at the Unite Europe 2017 event, here's the YouTube link, https://www.youtube.com/watch?v=n-RXnDGE72M. -- Hope this helps =)