NavMeshLib

v3.1.0·Updated 2026-10-05

A helper NavMesh library for Lethal Company.

About this mod Author’s original text

NavMesh Lib

A library with some useful functions for working with Unity's NavMesh system.

Custom NavMesh Agent IDs

Unity NavMesh system has code for registering custom agent IDs at runtime, but Unity

devs never exposed the method to update the settings from their default values.

NavMesh Lib uses some harmony patches to work around this to allow custom monster makers

to give their enemies custom NavMesh settings.

Do be warned there is a performance cost for adding new agent IDs as NavMesh Lib

hast to generate NavMeshes for each ID added.

Scripts for Moon Makers

NavMesh Lib includes has some helper scripts for moon makers for interactions with

custom agent types and allowing them to easily regenerate a moon's, (including interior's), NavMesh.

CustomNavMeshAgentHelper

A helper mono behavior that allows moon makers to set custom agent IDs at runtime.

Since NavMesh.CreateSettings can return a different ids at runtime.

We use CustomAgentManager.GetAgentIDFromSettingsName(string) to resolve the custom agent ID at runtime.

NavMeshUpdater

A helper mono behavior that allows moon makers to rebake the current scene's NavMesh.

You can customize how much of the NavMesh is regenerated:

AllSurfaces - Does what it says on the tin, rebakes all NavMeshSurfaces it can find.

ActiveSurfaces - Only rebakes all NavMeshSurfaces that are active and enabled.

OutsideSurfaces - Only rebakes NavMeshSurfaces parented to the OutsideLevelNavMesh.

InsideSurfaces - Only rebakes NavMeshSurfaces in the RoundManager.Instance.fullBakeSurfaces.

Custom - Allows you to specify which NavMeshSurfaces to rebake. WARNING: You are responsible for rebaking custom agent surfaces, if you use this, as well!

CustomNavMeshModifier

A helper mono behavior that allows moon makers to dynamically create NavMeshModifierVolume(s) for custom interiors, traps, and so much more.

You can customized where the modifier is parented to:

Interior - The modifier is parented to the Dungen object.

MoonEnvironment - The modifier is parented to the OutsideLevelNavMesh object.

Custom - The modifier is parented to the object you specify.

NavMesh Generation Improvements

NavMesh Lib also improves NavMesh generation by using UpdateNavMesh instead of BuildNavMesh.

Unity NavMesh generation is already multi-threaded but BuildNavMesh waits until the NavMesh is ready which block the main thread.

NavMesh Lib overrides base game NavMesh generation calls to use UpdateNavMesh which

allows Unity's main thread to keep running while still generating the new NavMesh in the background.

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack

File & checksum

Filename
NavMeshLib-3.1.0.zip
File size
127.6 KiB