Skip to main content

Cattoy Mouse

Based on game build 714014 | Last updated: 2026-03-04

Overview

cattoy_mouse is a lightweight inventory item that serves as a toy for catcoon-related entities (e.g., Kitcoons). It is designed to be thrown or dropped, where it exhibits randomized movement patterns upon being "played with" by a catcoon. The component leverages the locomotor and cattoy components to manage motion and interaction logic. It is not used for crafting but functions as a consumable environmental prop that triggers behavioral responses in nearby feline creatures.

Usage example

local mouse = CreateEntity()
mouse.entity:AddTransform()
mouse.entity:AddAnimState()
mouse.entity:AddSoundEmitter()
mouse.entity:AddDynamicShadow()
mouse.entity:AddNetwork()

-- Add components
mouse:AddComponent("locomotor")
mouse.components.locomotor:EnableGroundSpeedMultiplier(false)
mouse.components.locomotor:SetTriggersCreep(false)
mouse.components.locomotor.runspeed = 7

mouse:AddComponent("inventoryitem")
mouse.components.inventoryitem.nobounce = true
mouse.components.inventoryitem:SetSinks(true)

mouse:AddComponent("cattoy")
mouse.components.cattoy:SetOnPlay(function(inst) print("Playing with mouse!") end)

mouse:AddComponent("fuel")
mouse.components.fuel.fuelvalue = TUNING.SMALL_FUEL

Dependencies & tags

Components used: locomotor, inventoryitem, cattoy, fuel, inspectable, hauntable, burnable, propagator
Tags added: cattoy, kitcoonfollowtoy, donotautopick

Properties

PropertyTypeDefault ValueDescription
panic_taskTasknilPeriodic task that updates movement direction during play.
end_panic_taskTasknilDelayed task that cancels panic movement after ~61 frames.
animbankstring"cattoy_mouse"Animation bank used by AnimState.
animbuildstring"cattoy_mouse"Build name used by AnimState.

Main functions

No custom public methods exist on the prefab instance itself. Interaction is handled through callbacks registered on attached components (e.g., SetOnPlay on cattoy). Internal helper functions (panic_update, panic_cancel) are used exclusively for controlling behavior during play sessions.

Events & listeners

  • Listens to: None directly in this file. Interaction is handled via callback registration in cattoy:SetOnPlay(...).
  • Pushes: None directly in this file. The locomotor and cattoy components may emit events (e.g., locomote on start/stop of motion), but this prefab does not define listeners for such events.