Skip to main content
Version: 3.0

Concepts

The Problem​

While designing tutorials, you'll often need to reference objects that don't exist when the tutorial starts. These could be:

  • Dynamically created UI elements
  • Spawned enemies or characters
  • Objects that load in different scenes

Runtime Flags are designed to solve this challenge. They allow you to efficiently reference components that may not exist when a tutorial begins, enabling multi-scene setups with minimal configuration.

How Runtime Flags Work​

Unity's ScriptableObjects provide an excellent way to separate game logic from data and share runtime information between objects.

Runtime Flags operate on this principle:

  1. When a flagged object is instantiated, it registers itself with a shared ScriptableObject
  2. Your Tutorial Master component maintains a reference to this same ScriptableObject
  3. This creates a direct link between your tutorial system and the dynamic objects

This approach offers a more efficient way to resolve components at runtime compared to traditional methods like finding GameObjects by tags. It's faster and does not require scripting.