---
description: Rotate to face the direction of travel
---

# Auto Rotate

{% embed url="https://youtu.be/_tk1gvOwPZ0" %}

This behavior aligns an object to face (or otherwise orient itself) in the direction it is moving. This can be used with any object motion, no matter how it is being moved, even if indirectly through parental movement.

{% hint style="success" %}
To add Auto Rotate, right-click the object in the Timeflow view and select:

**Add Automation > Auto Rotate**
{% endhint %}

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FMpC0o9m5G216eApQWamC%2Fimage.png?alt=media&#x26;token=817f3e74-7286-429b-b630-7fb3b0bb231c" alt=""><figcaption><p>Auto Rotate has just 1 channel which outputs the calculated rotation.</p></figcaption></figure>

{% hint style="info" %}
**World Space**\
This behavior uses world space coordinates to calculate absolute position and rotation. Using local space is not applicable, however final local space rotation may be retrieved by accessing transform.localEulerAngles, or by exposing the Local Rotation channel in Timeflow.
{% endhint %}



## Auto Rotate Editor

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F6ncYgOW7hBI5sOQh7MwE%2Fimage.png?alt=media&#x26;token=97929b19-9f15-4239-b017-8afda2f50abe" alt=""><figcaption></figcaption></figure>

For common features please refer to [Menu Bar](../../../user-guide/timeflow-editor/menu-bar) and [Update Settings](../../../user-guide/timeflow-editor/update-settings).

{% hint style="warning" %}
**Play for Accurate Preview**

This behavior is calculated frame-by-frame and requires continuous forward play to accurately calculate rotation. When time skips or rewinds, the resulting rotation may be inaccurate, but auto-corrects upon play.&#x20;
{% endhint %}

## Calculate Only

Enable this option to calculate auto rotation without applying it to the transform.&#x20;

{% hint style="info" %}
The main use case for Calculate Only is when rotation data is being relayed through a [Channel Link](../../../user-guide/timeflow-view/channel-link) or script for further calculation or to drive effects.
{% endhint %}

### Orientation

Sets the overall heading of the object. Adjust the orientation to make the object face the intended direction. The default settings assume the +Z axis is forward.&#x20;

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FlXtHVuuVmuY89cq7dd0o%2Fimage.png?alt=media&#x26;token=2d817afb-420c-4803-a561-41c0d069f489" alt=""><figcaption></figcaption></figure>

### Up Vector

Determines which axis is upward for the object. The default and most common value is (0, 1, 0) however may be changed depending on the situation.

{% hint style="warning" %}
Up Vector may be set to any value though generally expects one of the cardinal directions (0,0,1) or (1,0,0) or (0,1,0) as defined in Unity [Vector3](https://docs.unity3d.com/ScriptReference/Vector3.html).  Other values are allowed but may cause odd rotations.
{% endhint %}

### Invert Direction

Flips the Auto Rotate direction 180 degrees. This is a quick way to fix an object that is facing the opposite direction than intended.

### Smooth Time

Applies temporal smoothing to average out movement and reduce bumps and jitter.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FwjyjPNXe6bgILDndCCNp%2Fimage.png?alt=media&#x26;token=79ac727e-6aea-499b-bc16-da9c6c232ca5" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
A small amount of smoothing (under 1 second) is generally recommended. If zero or too small amount is entered, the resulting rotation may be prone to abrupt changes and jitter due to minor movements and precision errors. Larger values have a dampening effect, making the rotation sluggish.
{% endhint %}

### Lock Axis

Restricts which axis are affected by Auto Rotate. This is most often used to fix an object on a plane, or when combining with other behaviors such as Auto Bank.

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FwuSemXHiGOYR1wkARLT6%2Fimage.png?alt=media&#x26;token=720d9b57-086b-4634-bfc1-d17a7b42959b" alt=""><figcaption><p>Shows the X and Z axis locked, so only the Y axis is calculated by Auto Rotate.</p></figcaption></figure>

{% hint style="info" %}
Each locked axis is assigned the Orientation value as the default.
{% endhint %}

{% hint style="danger" %}
If all axis are locked, Auto Rotate won't do anything! Unless this is intentional, make sure at least 1 axis is unlocked.
{% endhint %}

### Enable Override

<figure><img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2F6yhd7enDNZDNcbbvva6C%2Fimage.png?alt=media&#x26;token=7f5d0a15-7efe-4500-9bdc-3eb1add9043e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Auto Bank vs Auto Rotate?

At first glance these behaviors may appear to do the same thing, but are quite different in the results produced. While both are based on movement, [Auto Bank](auto-bank) calculates just 1 axis of rotation from 1 axis of lateral movement, whereas Auto Rotate aligns the object on all axis to face the direction the object is traveling. &#x20;
{% endhint %}

{% hint style="warning" %}
**Conflicting Rotations?**

It is often helpful to apply Auto Rotate on a separate parent transform so that it is isolated and does not interfere with other rotations. This uses the hierarchy to essentially layer transforms atop one another.

<img src="https://2067910529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3dOuetlQfYgK5FPUKgn%2Fuploads%2FeiiW68L6fnFbIwU52PSc%2Fimage.png?alt=media&#x26;token=1530f104-2385-4f6f-9168-adab19b15e79" alt="" data-size="original">

This is typically only needed for complex movements, such as when animating a vehicle or a camera rig.
{% endhint %}
