Tween Clip
Configure a target, values, and timing for one animated property
Overview
A Tween Clip animates one property. Its Module decides what changes, its target component decides which object changes, and its timing settings decide when it happens.
Add clips to a Tween Animator state, a component's sequence, or a Sequence Preset. The same module and timing settings are available in the Inspector and Timeline Window.
Target and Values
Choose a module from the clip menu, such as Transform -> Position or UI -> Canvas Group -> Alpha.
Assign the matching component as the clip's target. If you leave it empty, the module looks for a compatible component on the sequence owner's GameObject. It doesn't search the owner's children. For a child object, assign that component explicitly.
Most modules expose these value controls:
| Setting | Description |
|---|---|
| From Current | Reads the starting value when the clip actually begins, after its delay. |
| From | Explicit starting value, used when From Current is off. |
| Target | Value the clip moves toward. This is separate from the target component reference. |
Module-specific settings appear alongside these controls. For example, Transform position and rotation let you choose World or Local space. Scale always uses local scale.
Evo Tween captures a restorable value when a sequence is captured, then reads From Current when each clip begins. A later clip can therefore continue from the result of an earlier clip.
Timing
| Setting | Description |
|---|---|
| Flow | Parallel shares the current group's start; Sequential begins a new group after the previous group finishes. |
| Delay | Time added before this clip starts, measured from its group's start. |
| Duration | Length of one iteration in seconds. |
| Loop | None, Restart, or Yoyo. |
| Iterations | Total clip iterations when looping, with a minimum of 1. |
| Ease | How the value changes during each iteration. |
| Custom Ease | AnimationCurve used when Ease is Custom. |
With looping enabled, a clip's total length is Duration × Iterations. Delay is added once before the clip begins. Yoyo counts each direction separately, so two iterations play forward and back.
Clip loops are always finite. To repeat an entire animation forever, use the Tween Animator state's loop setting with Iterations = 0, or the code API.
See Tween Sequence for a worked example of Parallel, Sequential, and Delay.
Public API
Use TweenClip and TweenClipSettings in the Evo.Tween namespace.
| Member | Description |
|---|---|
Target | Explicit target component. |
Flow | Parallel or Sequential placement. |
Settings | Module, duration, delay, easing, and clip loop settings. |
Delay, Duration, Loop, Iterations, TotalDuration | Read-only access to configured timing. TotalDuration excludes delay. |
Clone() | Creates an independent configuration copy, retaining the target reference. |
Trigger() | Plays a copy of this clip. Requires an explicit Target. |
Trigger(GameObject owner, TimeMode timeMode = TimeMode.Scaled) | Plays with an owner for target resolution. Returns a TweenHandle. |
TweenClip.Trigger(owner, clips, timeMode) | Plays an ordered list using its flow and timing settings. |
TweenClipSettings.Trigger(component) and TweenClipSettings.Trigger(gameObject) are useful when a component owns settings without a full clip. TweenClipSettings<T> stores From/To values for a supported value type and starts playback through a setter callback.
Example
Configure the serialized clip in the Inspector, then call Play from a UnityEvent or another script:
using UnityEngine;
using Evo.Tween;
public class ClipPlayer : MonoBehaviour
{
[SerializeField] private TweenClip clip = new();
private TweenHandle handle;
public void Play()
{
handle.Kill();
handle = clip.Trigger(gameObject, TimeMode.Unscaled);
}
private void OnDisable() => handle.Kill();
}Keep the handle when you need to cancel a triggered clip. Kill() leaves the current value in place and doesn't invoke the completion callback.