Wormwood Mutantproxy
Based on game build 714014 | Last updated: 2026-03-07
Overview
wormwood_mutantproxy is a prefab used as a visual and logical intermediate during Wormwood’s Mutant pet transformation. When Wormwood transforms a pet, this proxy entity spawns, plays a transformation animation, emits a sound, and after 15 frames, triggers the actual pet spawn via PetLeash:SpawnPetAt. It does not persist in the world and is automatically removed after spawning the real pet or when the animation completes.
The proxy relies on the petleash component on the builder (Wormwood) to spawn the target pet at the proxy’s final position, and checks the builder’s health component to handle cleanup (e.g., removing the newly spawned pet if the builder died during transformation).
Usage example
-- This prefab is instantiated automatically by the game during Wormwood's pet transformation.
-- Modders do not typically spawn it manually.
-- However, to create a similar proxy for custom pets, one would:
local proxy = SpawnPrefab("wormwood_mutantproxy_carrat")
proxy.Transform:SetPosition(x, y, z)
Dependencies & tags
Components used: timer
Tags: None identified.
Properties
No public properties.
Main functions
finish_spawn(inst)
- Description: Internal helper called when the spawn timer completes. Uses the builder’s
petleashcomponent to spawn the actual pet prefab at the proxy’s location. If the builder is dead, it removes the spawned pet usingpet:RemoveWormwoodPet(). - Parameters:
inst(Entity) — the proxy instance. - Returns: Nothing.
- Error states: Does nothing if
inst.builderis invalid or lacks apetleashcomponent. ReturnsnilfromSpawnPetAtif the pet could not spawn (e.g., leash full), and does not callRemoveWormwoodPetin that case.
timerdone(inst, data)
- Description: Event handler for
"timerdone"; triggersfinish_spawnwhen the"finishspawn"timer expires. - Parameters:
inst(Entity) — the proxy instance.data(table) — event data containingnamefield; only triggers spawn ifname == "finishspawn".
- Returns: Nothing.
onbuilt(inst, data)
- Description: Event handler for
"onbuilt". Setsinst.builderto the builder entity (Wormwood) and attempts to adjust the proxy’s position to a walkable spot near the builder usingFindWalkableOffset. Also registers cleanup listener to clearinst.builderon removal. - Parameters:
inst(Entity) — the proxy instance.data(table) — builder data (typically containsbuilderfield).
- Returns: Nothing.
Events & listeners
- Listens to:
"timerdone"— triggersfinish_spawnwhen"finishspawn"timer completes."onbuilt"— initializes builder reference and adjusts position."animover"— callsinst.Remove(i.e., destroys the proxy) once animation ends."onremove"(onbuilder) — clearsinst.builderif builder is removed.
- Pushes: None.