# Update Settings

{% embed url="<https://youtu.be/LgFK7TlRnNo>" %}

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FzaCcGVNtPELuA1V8LttN%2Fimage.png?alt=media&#x26;token=1d61ab14-02db-4e9b-8a6e-5fc7d27a8621" alt=""><figcaption><p>All objects and behaviors display a similar Update Settings section.</p></figcaption></figure>

Timeflow offers a variety of options for controlling the frequency of animation updates. This can be set for a whole Timeflow instance, on a [TimeflowObject](https://axongenesis.gitbook.io/timeflow/reference/timeflow-object) to affect all of its behaviors and channels, or set on specific behaviors as needed.&#x20;

{% hint style="info" %}
These settings work in conjunction with the object [Track](https://axongenesis.gitbook.io/timeflow/reference/timeflow-object/tracks), which may used to block out specific sections of time.
{% endhint %}

{% hint style="success" %}
The update settings of the Timeflow instance affects all objects and animations it contains. This can be used to force an entire scene to a specific frame rate for stylization and/or performance.
{% endhint %}

## Update Mode

The first drop-down menu sets the Update Mode:

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FOcDIgiXITCjwnZPjPLBK%2Fimage.png?alt=media&#x26;token=2eaaf7f9-0ad2-4605-b54d-3e5abcab145e" alt=""><figcaption></figcaption></figure>

### Every Frame

This is the default mode and means that the component receives an update call every frame, as part of Unity's standard [Update](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Update.html) cycle.

### Force Framerate

This forces behaviors to update at the specified framerate. This can be used to create stop motion effects or to reduce the update frequency of behaviors with heavier calculations.&#x20;

{% hint style="warning" %}
Framerate is ultimately limited by hardware capabilities. This setting can only be used to lower the framerate and cannot force higher rates than can be rendered by the GPU.&#x20;
{% endhint %}

### Time Interval

This is similar to Forced Framerate, however the update is based on a specific time interval (in seconds) rather than on the number of frames rendered.&#x20;

### Update After

This mode is used to chain together behaviors in a specific update order. This is useful when one component bases calculations on values generated by another component.&#x20;

{% hint style="info" %}
Note that the current behavior updates *after* the behavior assigned. If the other object becomes inactive, the current object stops receiving update calls.&#x20;
{% endhint %}

### Explicit

This is used to control updating remotely via script or trigger. This is seldom used and only needed in special cases where a behavior may be controlled by game logic or other input.&#x20;

{% hint style="success" %}
When Explicit mode is used, an update may be forced using the [Refresh](https://axongenesis.gitbook.io/timeflow/user-guide/menu-bar#refresh) button.
{% endhint %}

## Update Method

The second drop-down menu selects the Unity method used for updating. This combines with the settings above for fully customizable timing.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FGvM32gXLeGKfVPNoc1bQ%2Fimage.png?alt=media&#x26;token=214433b6-8059-48de-8bb8-ee391221ebc1" alt=""><figcaption><p>Select from Unity's built-in update methods based on the type of animation being played.</p></figcaption></figure>

### Update

This is the standard update method and should be used for most objects. This is based on Unity's regular [Update ](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Update.html)call.&#x20;

### Late Update

Rather than updating during the standard Update call, this mode executes during [LateUpdate](https://docs.unity3d.com/ScriptReference/MonoBehaviour.LateUpdate.html) after all other objects have been updated. This can be used to force a behavior or object to update after everything else in the scene.&#x20;

{% hint style="warning" %}
Late Update should only be used on selective objects when absolutely needed. If possible, it is best to use the Update After mode as described above or use channel ordering to fix execution order dependencies.&#x20;
{% endhint %}

### Fixed Update

Using this mode, an object is only updated during [FixedUpdate](https://docs.unity3d.com/ScriptReference/MonoBehaviour.FixedUpdate.html), based on [Fixed Timestep](https://docs.unity3d.com/Manual/class-TimeManager.html) in Project Settings > Time. This is primarily used by physics to optimize performance by reducing the number of update calls. However, this can also be used on non-physics based objects too.

{% hint style="warning" %}
Always use Fixed Update for behaviors that use physics, such as when animating Rigidbody transforms. Otherwise jittering or other anomalies may occur in movement.
{% endhint %}

## Current Time

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FlK3jVLmSsWryikXaaQP6%2Fimage.png?alt=media&#x26;token=ae70b009-feea-4b2f-914b-6b2e43f41819" alt=""><figcaption></figcaption></figure>

This is a read-only value to display the local time of the object in the inspector. Normally this time is the same as is shown in the Timeflow view, however if any time offsets are applied to this object or its parents, then the local time displayed may be different than the current time in Timeflow.&#x20;

## Time Scale

This multiplies the playback speed of the behavior or object. For example, a Time Scale value of 2 will cause the playback to be twice as fast.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FVD10B2qwVHh606qcpbQO%2Fimage.png?alt=media&#x26;token=9c52ed43-acad-4321-84f6-c2048ef27d3a" alt=""><figcaption><p>Time Offset &#x26; Scale values are displayed in a separate column which may be expanded by clicking the small arrow icons. </p></figcaption></figure>

{% hint style="success" %}
Time Scale can be set on individual channels, behaviors, objects, and Timeflow instances (also referred to as Local Time Scale). Time Scale is inherited through the hierarchy and affects the display of tracks and keyframes in the track and graph views.
{% endhint %}

## Time Offset

This shifts the local time of the object forward or backward, relative to its parent or world time. This can be used to shift the time of whole objects or groups, while maintaining the relative timing of its keyframes, tracks, and children.

{% hint style="success" %}
The time offset value can be used to queue objects and animation channels at specific times, either in the editor or at runtime as part of game logic.
{% endhint %}

{% hint style="success" %}
Time Offset can also be set on individual channels and behaviors and works hierarchically, with each object having its own local time relative to its parent. &#x20;
{% endhint %}

### Drag Time Offset

This setting determines the behavior of dragging tracks in the Timeflow view. Normally this option is disabled and tracks are moved independently (like keyframes) without affecting other animations or the object's timing. However, when Drag Time Offset is enabled, dragging the track shifts the time offset for the whole object. &#x20;

{% hint style="info" %}
When enabled, tracks may still be dragged even if they are locked since this mode only affects the object's Time Offset and does not change the track itself.&#x20;
{% endhint %}

{% hint style="success" %}
To prevent tracks from being selected or moved, lock the object on the far left in the [Switches](https://axongenesis.gitbook.io/timeflow/user-guide/timeflow-view/switches) column.
{% endhint %}

{% hint style="warning" %}
Time Offset values not only affect the current game object's time but also its children and descendants.&#x20;
{% endhint %}

{% hint style="success" %}
An alternative to enabling Drag Time Offset is using the [Related Keyframes ](https://axongenesis.gitbook.io/timeflow/timeflow-view/tracks#related-keyframes)feature. When the Shift key is held while moving or editing tracks, any keyframes contained within the track section are highlighted in green and included in the edit. This allows greater creative freedom to move tracks independently or including the underlying keyframe data on the fly, without affecting time offset.&#x20;

See the [Tracks ](https://axongenesis.gitbook.io/timeflow/user-guide/timeflow-view/tracks)documentation for more details.
{% endhint %}

## Parent Object

This is a read-only reference to the first TimeflowObject in the object's parents. This is automatically determined by the object's placement in the scene hierarchy.&#x20;

{% hint style="info" %}
Timeflow only displays objects with a TimeflowObject component.&#x20;

When objects are in a contiguous hierarchy (each parent has a Timeflow Object), then Timeflow displays them in the view hierarchically, otherwise they may have to be added to the view separately.
{% endhint %}

## Restore Default Update Settings

Restores the update settings to default. Use this anytime you've made changes and want to restore the original update behavior. This doesn't affect other settings on the behavior.

## Additional Notes

### Stop Updating Every Frame

To prevent any behavior from automatically updating each frame, the Update mode may be set to Explicit. This means that the behavior only updates when the Refresh button is pressed.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FazsNlxjIbftRAxaF1E67%2Fimage.png?alt=media&#x26;token=40485cf4-dcc8-4312-b9dd-fd1a075d2632" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Use Explicit update for any behaviors you may be used for constructive purposes and not for animation. This way you can control when it updates by pressing the refresh button.
{% endhint %}
