Skip to content

Spawner templates

Most game entities, such as crates, enemies and platforms, are created by spawners. A spawner is an object with a Spawner_Template component that references a template: the object that is actually spawned and contains all of the entity’s advanced properties.

A crab spawner selected: its Spawner_Template component shows the template entity, its model and its thirteen components

  • The spawner usually has very few components of its own, such as a spline or a trigger volume. Its job is to set the position and rotation at which the template is spawned.
  • The template is displayed inside the Spawner_Template component (which is selected and expanded by default). You can change its model and edit any of its components.

Templates are listed under Templates in the object tree and hidden in the scene by default, because their own position is usually meaningless. For a few specific enemies the template position does matter; enable the Templates camera layer to see and move them. Most templates have a position of (0,0,0), those will stay hidden to preserve the frame rate.

Templates shown in the scene with the Templates camera layer enabled

A template can be referenced by several spawners. When you edit it from one of its spawners, through the Spawner_Template component, the editor first makes a copy of the template, so that the other spawners are not affected. Editing the template object directly will be reflected across every spawner that uses it.

Pasting a spawner brings its hidden template along and gives the copy its own template. Moving a spawner also moves the template (unless it’s located at the origin).

Spawners are typically activated by a script trigger. If the trigger is missing or misplaced, the template is never spawned even though the spawner is visible in the editor.