You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
May be user error, but I can't seem to fix despite copying the example scene exactly.
It collects the sources but for some reason does not cache them, despite them containing nav modifiers. This then stops me from being able to update the sources when they change position or are removed
I use the following code to create and update the navmesh
private IEnumerator StartNavMesh()
{
if (navMeshSurface.useGeometry == NavMeshCollectGeometry.PhysicsColliders)
{
yield return new WaitForFixedUpdate();
}
navMeshSurface.BuildNavMesh();
yield return null;
}
public void UpdateNavMesh(GameObject source)
{
cacheSources2D.RemoveSource(source);
if (cacheSources2D.IsDirty)
{
cacheSources2D.UpdateNavMesh();
}
}
The surface is a tilemap with a tilemap modifier, and it uses 3D objects with modifiers to mark the non-walkable areas
The text was updated successfully, but these errors were encountered:
I found the cause, the NavMeshBuilder2d class only contains the CollectSources functions for SpriteRenderer, Collider2D and tilemap, whereas I was using regular Collider for 3D objects.
I am unsure if this is an oversight, or a misuse of the components. The idea is to generate the nav mesh using the tilemap, and then create 3D objects with modifiers that are placed on the tilemap to generate the non-walkable areas. I added an overload for regular Collider component which fits my usecase for now.
Hi, tools has focus on 2d, never thought it will be used with 3d components. Can you make a PullRequest? I'll looks and try to add 3d cache support if its fits design.
Sadly the solution I'd come up with didn't actually end up working and I had to ditch the idea. But I think it's definitely feasible to add if you do wanna have a look in the future 👍
May be user error, but I can't seem to fix despite copying the example scene exactly.
It collects the sources but for some reason does not cache them, despite them containing nav modifiers. This then stops me from being able to update the sources when they change position or are removed
I use the following code to create and update the navmesh
The surface is a tilemap with a tilemap modifier, and it uses 3D objects with modifiers to mark the non-walkable areas
The text was updated successfully, but these errors were encountered: