LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[BUG]: Heavy Containment Zone meshes are not readable (NavMesh cannot be baked)

Open SwiftKraft opened this issue 1 year ago • 1 comments

Before You Report

  • [x] I have searched for existing reports of this bug, and this bug report is unique.

Version

1.1.0

Description

Image

I'm using NavMeshComponents, trying to bake a NavMesh for NPC navigation, but HCZ cannot be baked, as the meshes cannot be read.

To fix: go to mesh import settings for the HCZ meshes (and maybe GR18 and PT00 because they don't work either I'm pretty sure) and make sure that "Read/Write" is set to True

Image

To Reproduce

Import scripts from NavMeshComponents from Unity Technologies: https://github.com/Unity-Technologies/NavMeshComponents

Run this function:

        public static void BuildNavMesh()
        {
            if (NavMeshSurface != null)
            {
                NavMeshSurface.RemoveData();
                Object.Destroy(NavMeshSurface.gameObject);
            }

            NavMeshSurface = new GameObject("NavMesh").AddComponent<NavMeshSurface>();

            NavMeshBuildSettings settings = NavMeshSurface.GetBuildSettings();

            settings.agentClimb = 0.21f;
            settings.agentHeight = 0.83f;
            settings.agentSlope = 45f;
            settings.agentRadius = 0.25f;

            NavMeshSurface.useGeometry = NavMeshCollectGeometry.PhysicsColliders;
            NavMeshSurface.collectObjects = CollectObjects.All;
            NavMeshSurface.layerMask = NavMeshLayers;
            NavMeshSurface.overrideVoxelSize = true;
            NavMeshSurface.voxelSize = 0.05f;
            NavMeshSurface.overrideTileSize = true;
            NavMeshSurface.tileSize = 128;

            NavMeshSurface.BuildNavMesh();

            Logger.Info("NavMesh Built! ");
        }

Check the logs to see if the error occurs. Do note: UnityEditor might have different behavior than the actual runtime.

Expected Behavior

NavMesh bakes as usual, pathfinding is available to be used in HCZ.

Additional Information

LocalAdmin Log 2025-07-11 18.49.36.txt

SwiftKraft avatar Jul 11 '25 22:07 SwiftKraft

navmesh is epic and I have no clue how it was managed to make it not bake

Saskyc avatar Oct 14 '25 09:10 Saskyc