âī¸Tween
Create to-and-fro, one shot, and repeating animations
Last updated
Create to-and-fro, one shot, and repeating animations
Last updated
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.
Add a new Tween by right-clicking an object then go to Add Animation > Tween and select a target property from the list of components and materials on the object.
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.
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.
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.
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.
Tween displays its main property mapping at the top in the Menu Bar.
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.
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.
Sets an interval time in seconds. Use this to enter an exact time in seconds.
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.
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.
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.
Uses the full duration of TImeflow. Use this to create a tween animation that spans the full timeline.
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.
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.
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.
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.
When using Start At and End At, this determines what the Tween's resting value is.
This is the default mode which uses the start value for times before Start At, and the end value for time after End At.
Sets a constant value on the target property when Tween is not animating (before it starts, and after it ends).
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.
When Hold Mode is set to None, this can result in incomplete Tween animations when jumping in time. This isn't an issue during continuous playback, but while editing in the timeline if you move the current time from an active section of the Tween to an inactive section, it's value remains unchanged which may appear incorrect. Use one of the other hold modes if this becomes an issue.
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.
Act on Trigger must be enabled for Tween to receive Trigger() events. Also note that in the Tween script, this is defined as boolean AllowTrigger.
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.
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.
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.
Tween animates between the Start Value and End Value based on Timing and Repeat settings.
The start and end values must be constant and should themselves never by animated. Tween performs additional setup to optimize interpolations and changing these values dynamically at runtime will produce unknown results. To achieve something similar, use Channel Link.
If enabled, the final value is offset by the specified amount. This is useful to shift a Tween animation.
This value is safe to animate and may be a target property for another Tween.
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).
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.
Refer to Interpolation Modes in the Glossary.
Flips the interpolation to reverse the resulting animation curve.
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.
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.
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.
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.
This reduces the time interpolations occur but maintains the same duration overall. This has the effect of blending from full interpolation to none.
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.
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.
It is possible to target different properties by reassigning them in the object list, however note that Tween expects the properties to be of same or like type and doesn't offer any way to remap or change the value range per object, other than the settings shown.
To create more complex property mappings, use Channel Link to remap or modify Tween output values to other properties.
Select Children mode to use immediate children of the current object, or use Object List mode to manually assign objects and properties.
Be aware that if you use Tween to control other objects in the scene, it can lead to confusing scenarios unless target objects are noted or organized in way to know what's controlling it. This will be improved in future versions with tools to discover references.
If enabled, Tween does not affect the parent (current game object) and only applies the Tween to the child objects.
It is recommended to enable this when using Children mode to animate transforms, otherwise the child motion is compounded with the parent's.
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.
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.
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.
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.
Children or objects in the list must have the same target property as the parent, otherwise the default property mapping will fail and show errors. For example, if you're targeting the material property '_Color', each object in the list must have a material with the same property. This is not an issue with transforms since all objects have one. To solve this, simply make sure that each objects has the same component or material being mapped to.
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.
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.
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.
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.
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.
Displays the final computed value and channel options.
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.
Tween channels by default display a preview curve in the Track View and Graph View. To turn off the curve display, use the toggle in the Switches panel.