egametang/ET · critical · Exception

no nav data: {name}

Error message

no nav data: {name}

What it means

NavmeshComponent.Load awaits an EventSystem.Invoke<RecastFileLoader, ETTask<byte[]>> to fetch the navmesh bytes, then throws 'no nav data' if the returned buffer is empty. This is the load-time guard that fires before any DtMeshSetReader parsing.

Source

Thrown at Packages/cn.etetet.recast/Scripts/Model/Share/NavmeshComponent.cs:37

        
        public void Awake()
        {
        }

        public async ETTask Load(string name)
        {
            if (this.navmeshs.ContainsKey(name))
            {
                return;
            }
            
            byte[] buffer =
                    await EventSystem.Instance.Invoke<RecastFileLoader, ETTask<byte[]>>(
                        new RecastFileLoader() { Name = name });
            
            if (buffer.Length == 0)
            {
                throw new Exception($"no nav data: {name}");
            }
            
            DtMeshSetReader reader = new();
            using MemoryStream ms = new(buffer);
            using BinaryReader br = new(ms);
            DtNavMesh navMesh = reader.Read(br, 6); // cpp recast导出来的要用Read32Bit读取,DotRecast导出来的还没试过
            this.navmeshs.TryAdd(name, navMesh);
        }
        
        public DtNavMesh Get(string name)
        {
            return this.navmeshs[name];
        }
    }
}

View on GitHub (pinned to 5cab01f7a8)

Solutions

  1. Verify the recast nav file for the map exists at the expected resource path and is non-empty.
  2. Check the RecastFileLoader handler registration — confirm it maps the name to the right bundle/path.
  3. Confirm the resource/bundle system has actually loaded the map's bundle before Load is called.
  4. Bake/export the navmesh with the recast tooling if the file is missing.
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check file existence/content before calling Load
byte[] bytes = await EventSystem.Instance.Invoke<RecastFileLoader, ETTask<byte[]>>(new RecastFileLoader { Name = name });
if (bytes == null || bytes.Length == 0)
    throw new FileNotFoundException($"Recast nav file '{name}' is missing or empty");

Prevention

When it happens

Trigger: Load(name) is called and the RecastFileLoader event handler returns a zero-length byte array. The file lookup resolved but produced no content (or returned an explicit empty buffer).

Common situations: The recast (.nav) file is missing from the bundle/streaming assets so the loader returns empty; the file name has a typo or wrong path; the resource system isn't configured for the map; the file exists but is zero bytes on disk; wrong CodeMode/resource provider so the handler can't find it.

Related errors


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/1c6d210e3a152271. Report an issue: GitHub.