Skip to main content

Raindrop

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

Overview​

raindrop is a lightweight, non-persistent FX (visual effect) prefab that plays a single animation ("anim") and automatically cleans up after completion. It is designed for transient visual feedback, such as decorative rain particles or temporary splash effects. The entity does not persist across loads, cannot sleep, and is non-networked. It supports optional pooling via inst.pool for performance optimization.

Usage example​

local inst = SpawnPrefab("raindrop")
if inst ~= nil then
inst.Transform:SetPosition(x, y, z)
-- Use RestartFx to replay the animation if needed
-- inst.RestartFx(inst)
end

Dependencies & tags​

Components used: animstate, transform Tags: Adds FX.

Properties​

PropertyTypeDefault ValueDescription
pooltable or nilnilOptional reference to an entity pool. If valid, the entity is returned to pool.ents on animation completion instead of being removed.

Main functions​

RestartFx(inst)​

  • Description: Restarts the animation playback from the beginning. Typically called manually after spawning if the effect needs to be re-triggered.
  • Parameters: inst (entity) — the raindrop instance.
  • Returns: Nothing.

Events & listeners​

  • Listens to: animover — triggers OnAnimOver to handle cleanup (recycling or removal) when the animation finishes playing.

Events & listeners​

  • Listens to: animover — triggers OnAnimOver to handle cleanup (recycling or removal) when the animation finishes playing.
  • Pushes: None.