OrbitEnemyPurge

v1.0.0·Updated 2026-09-18

Automatically despawns, clears, and purges any enemies on the ship or scene when in orbit, preventing enemy transfer across moons.

About this mod Author’s original text

Orbit Enemy Purge

A lightweight, automated Lethal Company mod that clears, despawns, and purges all enemies when the ship enters or stays in orbit, eliminating the bug where enemies on the ship are transferred to other moons when landing.

The Problem

In vanilla Lethal Company and modded lobbies, enemies (e.g. Masked, Spiders, Baboon Hawks, Hoarding Bugs, or modded creatures) that enter the ship elevator bounds or get parented to the ship often survive scene unloading when the ship departs. Because the ship is persistent across scenes (DontDestroyOnLoad), these enemies remain on the ship in orbit and are transported to whichever moon you land on next.

How This Mod Solves It

Orbit Enemy Purge hooks into the ship's orbit lifecycle:

  • Round-End Scoreboard Display & Orbit Transition:
  • Triggers at the exact moment the performance report / scoreboard is shown in orbit (SwitchMapMonitorPurpose during EndOfGame), and when orbit is fully initialized (SetShipReadyToLand). Enemies remain visible during departure and are purged at the round conclusion before players revive.
  • Sweeps the entire scene and ship hierarchy for all EnemyAI entities, enemy colliders, and nest objects.
  • Authoritatively despawns networked enemy objects (NetworkObject.Despawn(true)) on host/server and destroys residual local instances on clients.
  • Clears RoundManager.Instance.SpawnedEnemies and resets active enemy power counters.
  • Pre-Landing Sweep (StartGame):
  • Immediately before ship descent begins when the lever is pulled for a new moon, a final purge executes to guarantee a clean ship arrival.

Configuration

Settings are saved to BepInEx/config/com.v0id.orbitenemypurge.cfg:

  • EnablePurgeOnShipLeave (Default: true): Purge all enemies when the round-end scoreboard is displayed in orbit.
  • EnablePreLandingSweep (Default: true): Purge immediately before descending onto a new moon.
  • LogPurgedEnemies (Default: true): Log sweep executions and purged enemy information in the console (both in orbit and when not in orbit).

Compatibility

  • Fully compatible with vanilla and modded enemies (all enemies derived from EnemyAI).
  • Preserves player corpses (DeadBodyInfo) for recovery, revival, and quota value.
  • Host and client friendly (host performs authoritative network despawn; client ensures local visual/collider destruction).

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
OrbitEnemyPurge-1.0.0.zip
File size
141.8 KiB