Skip to main content

Triggering Dialogue from Timeline

A Typewriter Event Marker lets you fire a dialogue event at a precise point in a Timeline sequence. This is useful for scripted scenarios where dialogue must appear at an exact moment rather than in response to a trigger zone or player action.

Before setting this up, make sure your scene already has a working dialogue setup. If you have not done that yet, see Setting Up Dialogue in a Scenario.

1
Add the track to your Timeline
  1. Open the Timeline asset in the Timeline window.
  2. Click Add and select Typewriter Event Marker Track. Custom tracks may be grouped under a submenu named after their namespace (mobisim.Dialogue.Timeline).

Timeline window with the Add menu open, showing Typewriter Event Marker Track in the list

2
Bind the receiver

The track needs a TypewriterEventMarkerReceiver component in the scene to receive and handle the events.

  1. Select the track's binding slot in the Timeline window.
  2. Assign the GameObject that has the TypewriterEventMarkerReceiver component. If none exists yet, add the component to any scene-manager GameObject first.

Timeline track binding slot with TypewriterEventMarkerReceiver assigned

note

All markers on the same track share one receiver and one dialogue context. State set by one marker, such as a fact being marked true, carries over to the next marker on the same track. Facts in a Global or Scene scope are shared with every other event source as well; only facts in a plain Scope are private to the receiver.

3
Place a marker
  1. Right-click the track at the point in the timeline where you want the dialogue to trigger.
  2. Select Add Typewriter Event Marker.
  3. Select the marker in the Timeline window to open it in the Inspector.

TODO: Screenshot - Inspector showing a TypewriterEventMarker with the Event field and option toggles visible

Typewriter Event Marker
Field
Description
Event
The dialogue event to trigger. Only entries of the Event type are shown in the picker.
Retroactive
If enabled, the marker fires even when playback starts after its position. Use this when the dialogue should always appear, regardless of where in the timeline playback begins.
Emit Once
If enabled, the marker fires only the first time the timeline passes it. It does not fire again if the timeline loops or is scrubbed back over it.
4
Select the dialogue event
  1. Click the Event field on the marker.
  2. Select the Event entry you want to trigger from the picker.

The dialogue now fires when the timeline reaches the marker in Play mode.

TODO: Screenshot - Event picker open on the marker inspector showing a list of Event entries from the database

tip

Test by entering Play mode and scrubbing the timeline to just before the marker. The dialogue should appear when the playhead crosses it. If nothing appears, check that the TypewriterSequencer is in the scene and that the selected event has at least one matching rule.