↔️Tween

Create to-and-fro, one shot, and repeating animations

Tween is used for creating oscillating motions on any property with a range of options. Use Tween for anything that pulses, bobs, spins, or moves back and forth. Motions can be precise and regular or random and chaotic. Create animations that play once or loop.

Use the context menu as shown above to add new Tween channels

Channel and Property Mapping

Each Tween has only 1 channel, but multiple instances may be added per object. Each Tween has its own settings and channel. Reassign properties mappings as needed using the Info Panel or in the inspector.

Click the property name button in the Info Panel to select a different property.

As with all other behaviors in Timeflow, Tween only processes animation during active track sections, as depicted in the screenshot below, unless Always Update is enabled.

Optionally use track sections to

Tween channels do not have keyframes, but may be used with channel links, to combine with keyframe and other animation channels for more complex motion.

Tween Editor

For setup and additional editing features, select an object and view the Tween editor in the Inspector. For common features, please refer to Properties, Menu Bar and Update Settings.

Default settings for new Tween in the Inspector view.

Tween displays its main property mapping at the top in the Menu Bar.

Usage

Once Tween has been applied to an object and target property selected, adjust the Timing section to set the desired duration and repeat interval if any. Adjust the Tween settings to set the start and end values, interpolation method, and optional randomization and offset.

Timing

Duration

Sets the time it take to complete 1 interval of animation. A single interval animates from the start value to end value over the duration, or if To and Fro is enabled then a single interval goes from start, to end, to start, over the same duration.

Seconds

Sets an interval time in seconds. Use this to enter an exact time in seconds.

Beats

Sets the interval time based on BPM. When this mode is enabled, the Note field is also displayed to select the note type and count, determining the interval duration. If the Timeflow BPM checkbox is enabled, it automatically uses the BPM as set in the Timeflow settings. Otherwise this can be unchecked to enter a specific BPM for this Tween.

Markers

Uses Markers to set the start and end time of the Tween. This lists all markers in Timeflow, though if none have been created then only START and END (the built-in markers) are displayed.

Object Duration

Uses the duration of the containing TimeflowObject based on the start and end of its track channel. This spans from the start of the first track section to the end of the last track section.

Total Time

Uses the full duration of TImeflow. Use this to create a tween animation that spans the full timeline.

Start At

Sets the start time of the animation. These are similar to the options described above, but specify an exact time rather than a duration. Tween only begins animating once the time is reached or passed. Start is the default to play immediately.

The Trigger option is a scripting feature that allows Tween to start animating when Trigger() is invoked, and to stop when TriggerStop() is invoked. This can be done via script using a reference to the Tween object, or using Unity SendMessage.

End At

Determines the time at which Tween stops animating. The default mode is Never, which means the Tween continues to animate as long as the object is active in the timeline.

Repeat

Determines how many cycles of the animation to play.

Forever is the default mode, meaning the Tween never stops repeating. On the otherhand if No is selected, then animation is not repeated and the Tween plays its animation just once based on the Duration settings above.

The options for Repeat Every are similar to the Duration above.

When Every mode is selected, a secondary set of options defines the repeat interval, which can be different than the Duration to control spacing of the animation over time. This can be used to create animations that occur periodically rather than looping back-to-back.

An example using Repeat Every duration to increase hold duration between cycles

Hold Mode

When using Start At and End At, this determines what the Tween's resting value is.

Hold Start and End Values

This is the default mode which uses the start value for times before Start At, and the end value for time after End At.

Default Value

Sets a constant value on the target property when Tween is not animating (before it starts, and after it ends).

None

If this mode is selected, Tween does not process or apply any values and the target property is left unchanged whenever the time is before the start and after the end.

Act on Trigger

This is an advanced feature that allows Tween to be started and stopped via script. This directly relates to the Start At Trigger mode described above.

Complete Cycle

When enabled, Tween finishes animating the current interval before it can be stopped or restarted by trigger events. Any extra messages sent during these times may be ignored. This can be used for interactive elements to ensure that each Tween trigger goes to the full 'on' and 'off' positions without interruption and only responds to new triggers once complete.

Random Seed

Sets the seed value for the random number generator used in the +/- fields. This value may be changed to make variations on Tweens using randomization.

Tween

Sets the start and end values for the tween animation.

The type of values displayed is determined by the property selected. Tween supports numeric and color properties only, since object and string values cannot be interpolated.

Start / End Value

Tween animates between the Start Value and End Value based on Timing and Repeat settings.

Offset

If enabled, the final value is offset by the specified amount. This is useful to shift a Tween animation.

Randomization +/-

This optionally adds a random range to the start and end values, based on the Random Seed.

The randomization value (+/-) sets a potential offset range that may be plus or minus the target value. In the example shown above, the Start Value may be any number between -5 and 5 (0 +/- 5), whereas the End Value may be any number between 5 and 15 (10 +/- 5).

The resulting graph preview showing the randomization values applied above.

Tween pre-calculates random values so that the resulting animation is deterministic. This means that randomization is consistent each time curves are recalculated. Use the Random Seed value for variations.

Interpolation

Refer to Interpolation Modes in the Glossary.

Invert

Flips the interpolation to reverse the resulting animation curve.

To and Fro

If enabled, animation goes back and forth (start -> end -> start), otherwise the animation goes one direction (start -> end).

Tip: Continuous Rotation Make an object continually rotate by setting the Start Value to 0 and the End Value to 360, and disable To and Fro. Select Linear interpolation for steady smooth rotation. Then adjust the speed with the Duration.

Amount

Use this slider to reduce the intensity or degree of animation. This blends the value towards the Default Value, or to 0 if another Hold Mode is selected.

Note that Offset is applied after Amount, so that it may be used to adjust the final value.

Phase

Offsets the tween cycle to shift the animation forward or backward in time.

Phase can be useful to offset the timing of similar or duplicate animations to create the effect of a delay or staggered movements.

In/Out Point

Adjust the in and out points to add padding (in time) to either end of each cycle. This also shortens the duration of the actual animation.

Adjusting the in and out points affects the curve as shown below.
This is somewhat similar in result to Repeat Every but a different approach.

Smoothness

This reduces the time interpolations occur but maintains the same duration overall. This has the effect of blending from full interpolation to none.

Use Smoothness to accelerate value transitions and increase hold times.

The lower the smoothness, the faster the transition and longer it holds the end value. If smoothness is 0, it is the same as None interpolation.

Multiple Objects

This is an advanced feature to apply a Tween animation on a series of objects. The most common setup is for a parent object to control children by apply the same Tween to each.

This can be used to create waves, pulses, and other effects that travel through a series of objects, or affect them all in unison.

To create more complex property mappings, use Channel Link to remap or modify Tween output values to other properties.

Apply to Each

Select Children mode to use immediate children of the current object, or use Object List mode to manually assign objects and properties.

Children Only

If enabled, Tween does not affect the parent (current game object) and only applies the Tween to the child objects.

Offset Each

This specifies a duration (optional) to offset each the Tween as it applies to each object in the list. This is useful for creating trailing motions that move through the objects rather than happening all at once.

Envelope

This varies the amount of the Tween as it is applied to each object in the list based on the curve type selected. This essentially applies the curve profile across the objects.

Envelope effect of Ease In Out (applied to the Y position of objects)

One or both ends of the list may be pinned in place depending on whether an In or Out curve is selected. For further documentation on the curve modes, see Interpolation Modes.

Objects List

Use the list of objects to manage each property assignment. Each object is initially assigned the same property as in the Tween settings. Use Gather Children to recollect and rebuild property mappings for all child objects.

Gather Children clears the list first, so do not use this button if you wish to preserve current object assignments. Otherwise, this is a good way to rebuild the list after changes have been made.

Additional property settings are shown by clicking the circular link icon to the left of the property button.

Recursive

Enable this to work with all game objects in the hierarchy. This also affects Find by Name, allowing it to traverse the whole hierarchy to find objects with matching names.

Find by Name

Finds all the objects that match the name entered (in the field shown). Enable Exact to match names precisely, or otherwise find any object that partially matches it. This can be helpful for targeting multiple objects distributed throughout a hierarchy without having to change the structure.

This operation searches the hierarchy of the current object (or one assigned with Apply to Each), however once the list has been created the property mappings are preserved no matter if the objects are reparented and moved.

Overrides

Provides a way for a Tween to be remote controlled, or to blend to a specific value. This is often used in cases where a Tween behavior needs to transition into or combine with keyframe animation.

Override Interpolation

This takes over control of the interpolation (i.e. amount of completion between the Start Value and End Value). This does not blend with the original Tween timing and fully overrides it. When enabled, the slider blends between the start and end values according to the interpolation type selected. The interpolation value may then be animated or controlled via channel link or script.

Override Value / Blend

If Override Blend is greater than zero, the final output of Tween is blended with the Override Value. The value may be constant, animated with keyframes, or using a channel link. The blend slider can then be animated to transition smoothly from the Tween motion to the override value.

Both override modes may be used together if needed. Note that the Override Value / Blend takes precedent over Override Interpolation.

Output

Displays the final computed value and channel options.

Note that the Final Value is for display only and cannot be set directly.

Note that Tween does not support the channel looping features since it provides its own looping mechanisms.

See Channel Link and Set Shader Global for more details.

Last updated