Skip to main content

Placement Set

The Decorator. Staps multiple prefabs across the map based on a table of rules and multiple input weight/mask channels.

Ports

PortTypeDescription
Weights Float (Multi)A list of weight channels. Rules reference these by their index (Weight Slot).
Masks Bool Mask (Multi)A list of mask channels. Rules reference these by their index (Mask Slot).
Output PlacementsThe aggregated list of prefab placements.

Details

This node is a powerful bulk-placement tool. Instead of having 20 separate Prefab Spawner nodes, you can use one Placement Set node and a table of rules to manage a complex distribution of props.

Parameters

  • Rules: A JSON-encoded table (authored in the custom inspector) where each row contains:
    • Prefab: The Prefab Asset to spawn.
    • Weight Slot: Which input channel from the Weights port to use.
    • Mask Slot: Which input channel from the Masks port to use (optional).
    • Threshold / Density: Controls the probability and frequency of placement.
    • Offset X/Y: Local positional adjustment.
    • Mirror X/Y: Randomly flips the prefab.
    • Allow Rotation: Randomly rotates the prefab in 90-degree increments.

Potential Use Cases

  • Biomes with Specific Foliage: Connect a "Forest Weight" to Weight Slot 1 and a "Swamp Weight" to Weight Slot 2. In the rules, assign "Pine Trees" to Slot 1 and "Mangroves" to Slot 2 to populate both biomes in one node.
  • Layered Props: Place "Grass Tufts" at high density (0.8) and "Rocks" at low density (0.1) using the same "Meadow Mask."
  • Dungeon clutter: Use different slots for "Crates," "Barrels," and "Torches," then use a "Room Mask" to ensure they only spawn inside playable areas.