Skip to main content

Plantable

Overview

The Plantable component stores foundational data for entities that can be planted and later grow into a new entity or produce a harvestable item. It defines the growth duration and identifies the resulting product entity, but does not implement the actual planting, growing, or harvesting logic—those responsibilities are handled by other components (e.g., grower, harvestable, or producer).

Dependencies & Tags

None identified.

Properties

PropertyTypeDefault ValueDescription
growtimenumber120The default time (in seconds) required for the entity to mature after planting.
productstring?nilThe name of the prefab to spawn when this plantable grows; if nil, no product is automatically generated.

Main Functions

Plantable(inst)

  • Description: Constructor for the component. Initializes the component instance with the given entity (inst) and sets up default growth time and product values.
  • Parameters:
    • inst: The Entity to attach this component to.

Events & Listeners

None identified.