- Home /
Baking Navmesh at runtime ignores 'Include Layers' property.
Hi,
I already asked this question on the NavMechComponents github issues, but no response. So im asking here too.
Please see the link for info... https://github.com/Unity-Technologies/NavMeshComponents/issues/72
When i bake a navmesh at runtime it appears to ignore the 'Include Layers' property in the navmeshsurface component. This creates an unusable navmesh as it goes around the agents. When baking the navmesh offline using the 'Bake' button on the surface component it works as expected.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class NavigationManager : MonoBehaviour
{
public NavMeshSurface surface;
public void Rebake()
{
if (surface)
{
surface.BuildNavMesh();
}
}
}
Answer by FileThirteen · Jan 01 at 04:10 AM
I have the same issue.
It's kind of a bad solution but you can do something like create a script to enable whatever it is after your navmesh is baked. That's what I'm already doing for some of my stuff. Basically just disable it and then have it become enabled after the navmesh is baked. Not perfect and very late.
Your answer
Follow this Question
Related Questions
NavMesh giving jerky like motion 0 Answers
Toggling NavMeshAgent and NavMeshObstacle 2 Answers
check if agent reach destination 1 Answer
line in navmesh obstacle 1 Answer