🛸Auto Bank

Auto calculate pitch and roll based on object movement

An Auto Bank channel is added which outputs the current banking value as rotation in degrees.

Auto Bank is most commonly used to add extra roll or pitch to an object based on its movement. This is determine by the object's velocity, calculated as the difference in position each frame.

Auto Bank Editor

Select the game object and view it in the Inspector view to configure settings.

For common features please refer to Menu Bar and Update Settings.

Input Mode

Determine the input source of movement from which auto bank is calculated.

The input does not have to be 'movement' per se and can be any numeric channel input. Auto Bank simply reacts to relative changes, whatever the input source may be.

World Space

Enable this to force calculation in world space, otherwise positions are treated as local coordinates.

When using a Motion Path as input, turn off World Space to follow the path contours. Banking is then calculated from the turning direction relative to the heading of the object.

Object Movement / Movement Axis

Uses the object's transform position to generate banking. Select the axis of movement (position) to generate banking from.

Typically side-to-side movement (X) is used to calculate roll, whereas pitch is calculated from up-down movement (Y). Other combinations may be used to create dynamic spinning and spiraling effects based on movement.

Motion Path

Use a Motion Path from the same or different object with optional Time Offset. The default offset is 0.25 seconds to allow a bit of lead time to anticipate banking.

If the motion path is on a separate object, Auto Bank still rotates as expected, however the object's position remains unaffected. This makes it possible to decouple the banking movement from the position.

Channel Value

This mode uses another channel (on the same object) as an input value to calculate Auto Bank. This can be a position channel, or any numeric data type, though just 1 axis or float value is used as input.

Channel Value mode also supports Time Offset, which works similarly as described above for the Motion Path mode.

Movement Scale

This multiplies the movement input value, controlling the overall intensity of banking.

Threshold

Determines the minimum change of input (i.e. movement) required to register a change. If the relative change in input value (from any Input Mode) is below the Threshold, it is ignored.

Increase the threshold to make Auto Bank less sensitive to minor object movement, or lower the threshold to make auto bank more sensitive.

Banking

This controls the amount and degree of rotation, applied to the Axis selected. The Banking value affects how much banking is applied over the change in movement. A lower value reduces the effect, and a higher value increases it.

Max

This sets the maximum rotation value allowed for this axis. The value is enforced as both a negative and positive rotation.

Min Max

Use this mode if you wish to set explicit minimum and maximum values. This will keep the banking rotation within the rotation range specified.

No Limit

Use this mode to allow banking to rotate endlessly.

Reset On Rewind

If enabled, the banking rotation is reset to 0 whenever Timeflow rewinds or loops. However, for looping paths you may wish to disable this for seamless banking when looping.

Apply to Axis

This sets the rotation axis to apply banking too.

Auto Bank can only generate 1 axis of rotation, however you may apply multiple instances of Auto Bank to create behaviors for pitch, roll, and yaw. If applied to the same object, the Orientation should only be set on the first one.

Invert

If Invert is enabled, the value range is swapped.

Orientation

Optionally sets the base rotation of the object.

If Orientation is off, the Auto Bank behavior applies additively with existing rotations on the object. Otherwise if Orientation is on, it overwrites the object's rotation when applying banking.

Smooth Time

Applies temporal blending to create smoother more graceful banking.

Smooth Time is defined in seconds and does impart a delay to the banking response.

Use a higher value of Smooth Time to create a slower auto banking response (sluggish), and a lower value to speed up banking response time (rapid).

Cumulative

If enabled, the banking rotation accumulates over the distance travelled (or based on the change of the input value). Use this option for objects that spin or corkscrew.

To fully utilize this effect and allow an object to spin more freely, enable No Limit or increase the rotation limit to an acceptable amount.

Dampen

This multiplies the banking amount when cumulative is enabled to reduce the banking so that it is easier to control. Since cumulative mode amplifies banking, the dampen amount is used to counteract that. This value may be adjusted to increase or decrease the rate.

The final rotation is checked for NaN (not a number) values in case infinity is reached. If this occurs, the rotation reverts to 0. If this is an issue in your setup, you may consider setting a max value.

Additional Notes

Late Update

If Auto Bank is applied to the same object it bases movement from, it may be helpful to use Late Update, set in the Update Settings. This will result in Auto Bank updating after all other behaviors have been updated. This can fix jitter or shaking behavior that may occur otherwise.

Last updated