⏰Event

Trigger a function or event at a specific time during playback

Events provide a way to invoke function calls during playback to implement custom behaviors. This is primarily used to initiate or end a state related to game play or other interactive applications.

Events are added at the current time and displayed as a small flag icon on the object Track.

Note that Events do not have any channels and instead appear like a keyframe on the track channel, as shown above.

Editing Events in the Info Panel

Click on an event in the Track View to view its settings in the Info Panel. Please see the editor section below for more options and further explanation of each setting.

Multiple events may be selected at once for bulk editing in the Info Panel.

Event Editor

Select the game object to view Event settings in the Inspector. Events, like all other behaviors, are applied as components, with no limit on the number of events applied to each object.

Events do not allow Update Settings to be customized, otherwise it may not perform as expected or events may not trigger at all.

Please refer to Menu Bar for common features.

Event Name

Enter a name to help manage and identify events. This is for organizational purposes and is not required nor does it affect functionality.

Triggered

Indicates when the event has been fired (checked) or not (unchecked). This gets reset upon start and when rewinding the timeline in edit mode.

Setting the Triggered checkbox manually overrides the internal tracking of whether or not the event has been fired. This may be useful while testing to allow or prevent an event from firing.

Trigger Now

Use this to invoke the event function immediately bypassing any restriction on limit. This is used only for testing events.

Trigger Time

Sets the time the event is to be triggered during playback.

Trigger Time is in local time which may be affected by Time Offset.

Set to Current Time

Assigns the event time using the current time of the playhead.

Lock

Enable lock to prevent the event time from being changed. This also prevents dragging events in the Track View.

Trigger Limit

Events may be limited to perform only a certain number of times during each run. This value may be left at 0 for the event to be fired without limit.

To make sure an event only fires once, enter 1. Or enter any number the event is allowed to be retriggered.

Under normal circumstances, Timeflow plays through just once and the limit is not needed. However, when looping sections of time or rewinding to replay from the beginning, this may be needed to ensure certain actions aren't repeated.

Trigger Limit is primarily used for interactive applications. For example, it could be used to display instructions to a user only the first time playing through a scene, but skipped on replays (during the same session). Or it could be used with other interactive contexts that limits the number of times a user is allowed to repeat actions.

Send Message To

Uses GameObject.SendMessage to invoke the named method and optional parameter. This works in edit mode if the target method does.

Function and Parameter

Enter the exact name of the class method and leave blank or enter a parameter value to pass to the function when invoked. Below are examples showing how to implement methods in a component script.

public void MyMethod()
{
    Debug.Log("MyMethod");
}

public void MyMethod(string value)
{
    Debug.Log("MyMethod:" + value);
}

OnTrigger()

Use Unity Events to trigger any object or property value.

Example using a trigger to deactivate an object. Use the + button to add more functions to the event.

Trigger State Reset

Event Timing and Latency

During playback, the precise time of an Event may not exactly align to the current time due to frame rates and timing intervals. To determine when an event is triggered, Timeflow checks whether the event time falls within the last update time and the current time (ignoring explicit jumps in time).

In most cases the discrepancy between the set trigger time and the actual time triggered is microseconds. However, in cases where frame rate has dropped or playback is skipping for other reasons, the actual event time triggered may be delayed.

Testing Events

Event Scripting

The behavior is officially named TimeflowEvent so as to avoid ambiguity with other event types in Unity. Custom event implementations may also be created using TimeflowEvent as a base class. See TimeflowEvent.cs and Scripting for more information.

Last updated