Corpse Gestalt
Based on game build 722832 | Last updated: 2026-04-17
Overview
corpse_gestalt is a lunar-aligned enemy prefab that spawns from lunar rifts and can be captured by players. It features entity tracking capabilities to follow targets, sanity aura effects, and locomotion configured for both walking and running speeds. The prefab uses a custom state graph and behavior brain for AI control, and integrates with the gestalt capture system for player interaction.
Usage example
-- Spawn the corpse gestalt prefab
local gestalt = SpawnPrefab("corpse_gestalt")
-- Note: Spawn() and SetTarget() are only available on master simulation
if TheWorld.ismastersim then
-- Set a target for the gestalt to track
local player = ThePlayer
gestalt:SetTarget(player)
-- Trigger spawn animation
gestalt:Spawn()
end
-- Access components for customization
gestalt.components.sanityaura.aura = TUNING.SANITYAURA_HIGH
gestalt.components.gestaltcapturable:SetLevel(3)
Dependencies & tags
External dependencies:
prefabutil-- prefab helper utilitiesbrains/corpse_gestalt_brain-- behavior tree for AI controlprefabs/rift_portal_defs-- lunar rift affinity constants
Components used:
entitytracker-- tracks target entity via TrackEntity/ForgetEntitysanityaura-- provides sanity aura effect (TUNING.SANITYAURA_MED)locomotor-- handles movement speeds and pathfinding capsgestaltcapturable-- enables capture mechanics with level and planar settingsknownlocations-- tracks known locations for navigation
Tags:
brightmare-- added on creationNOBLOCK-- added on creation, prevents blockingsoulless-- added on creation, prevents wortox soul extractionlunar_aligned-- added on creation, indicates lunar affinitygestaltcapturable-- added on creation, marks as capturable
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
| None | No properties are defined. |
Main functions
Spawn()
- Description: Initializes the gestalt with random rotation and triggers the spawn animation state. Called after the prefab is instantiated to begin its lifecycle.
- Parameters: None
- Returns: None
- Error states: Errors if
inst.sgis nil when callingGoToState()— stategraph must be assigned before calling Spawn.
SetTarget(target)
- Description: Assigns a target entity for the gestalt to track. If target is valid, tracks it via entitytracker and teleports the gestalt from a lunar rift or near the target position. If target is nil or invalid, forgets the tracked entity.
- Parameters:
target-- entity instance to track, or nil to clear target - Returns: None
- Error states: None
Events & listeners
None identified.