Wiki
  • Homepage
  • Player's Manual
    • Controls
    • Skills
    • Objects
    • Credits
  • Contributing
    • Getting Started
      • Programs and Files
      • Cloning the GitHub Project
      • Git Structure
      • Submitting Changes
    • Level Design
      • Basic Level Setup
      • Creating Static.tscn
      • Creating Collision.tscn
      • Stage Triggers
        • Using StageTrigger.tscn
        • Camera Triggers
        • Culling Triggers
        • Death Triggers
        • Dialog Triggers
        • Jump Triggers
        • Path Triggers
        • Automation Triggers
        • Drift Triggers
        • Foothold Triggers
        • Platform Triggers
        • Sidle Triggers
      • Stage Objects
      • Placing Objects Along the Path
    • Playtesting
      • General Shortcuts
      • Debug Menu
      • Free Camera Mode
      • Using the Editor for Playtesting
    • Submitting a Bug Report
    • Documentation Style Guide
  • Asset Guidelines
    • Source Files
    • Asset Ripping Reference
      • Original Model Files
    • Asset Editing Reference
      • Editing Environment Models
      • Editing Collision Models
      • All About Curves
      • Exporting Models from Blender
    • Resources Files
      • CameraSettingsResource
    • Miscellaneous Notes
  • Godot Guidelines
    • File Guides
      • File Structure
      • Naming Files
    • Project Settings
      • Tag Reference
      • Layer Reference
    • Particle Effects
    • Audio
  • CODE GUIDELINES
    • Language Specifications
    • Formatting
    • General guidelines
    • Attributes
    • Floating Point Numbers
Powered by GitBook
On this page
  • Properties
  • Methods and Callbacks
  • Usage
  1. Contributing
  2. Level Design
  3. Stage Triggers

Using StageTrigger.tscn

PreviousStage TriggersNextCamera Triggers

Last updated 11 months ago

StageTrigger.tscn is a node that automatically activates and deactivates all of its child .

Sometimes, connecting signals from other nodes may be inefficient because the same node would need to be added for multiple scenes. Other times, it is impractical because there is no specific object tied to a trigger's activation. To solve this, we can use StageTrigger.tscn instead.

To use StageTrigger.tscn, follow the steps below:

  1. Instance StageTrigger.tscn.

  2. Add a CollisionShape3D as a child node.

  3. Select the CollisionShape3D node, and set its Collision Shape property in the inspector.

  4. Adjust the StageTrigger.tscn node's properties as needed.

Notes about StageTrigger.tscn and Collision Shapes:

  1. Try to reuse collision shapes from other StageTrigger.tscn nodes. instead of creating new ones. This can be done by copying and pasting the previous StageTrigger.tscn's collision shape.

  2. StageTrigger.tscn calculates whether the player is moving forward or backwards relative to the level's path, so try to align its position as close to the path as possible.

  3. Barring a few exceptions, try to make the collision shape extend at least 15 units off the ground so the player cannot simply jump over it.

  4. The typically CollisionShape is a BoxShape3D with extents of (15, 20, 2.5) and a local position of (0, 8, 0).

Properties

  • One Shot - Enable this if the StageTrigger.tscn node should only be allowed to activate once.

  • Trigger Mode - Determines how the stage trigger will be activated.

    • OnEnter - Only activate when the player enters the CollisionShape3D.

    • OnStay - Activate when the player enters the CollisionShape3D, deactivate when the player exits.

    • OnExit - Only Activate when the player exits the CollisionShape3D.

  • Enter/Exit Mode - Determines when activation can happen. Enter Mode is not available when Trigger Mode is set to OnExit, and Exit Modeis note available when Trigger Mode is set to OnEnter.

    • Both Ways - Process trigger regardless of the player's entrance/exit direction.

    • Moving Forward - Only process trigger logic when the player is moving forward in the level.

    • Moving Backward - Only process trigger logic when the player is moving backwards in the level.

Methods and Callbacks

  • Activated - Emitted when the StageTrigger.tscn node becomes active.

  • Deactivated - Emitted when the StageTrigger.tscn node becomes in inactive.

  • Respawned - Emitted when the the player respawns.

Usage

Additionally, most static triggers such as Culling Maps and Events use StageTrigger.tscn to determine when to be activated by the player.

StageTrigger.tscn forms the backbone of all stage triggers in . It is most commonly used for and , as they typically remain the same between stages.

Static.tscn
Path Triggers
Camera Triggers
Stage Triggers
StageTrigger.tscn node with a PathTrigger attached.