Repository navigation
From and To
Most steps travel to a value. They can optionally start from one too.
The button at the start of a step's first value row switches between two setups:
-
TO(the default): one row. The step travels from wherever the value already is to the value you type. -
FROM: that row becomes the starting value, and a To row appears underneath. The step jumps to From, then travels to To.
Use TO for things like hover effects that should carry on smoothly from wherever they are. Use FROM when the animation should always look the same, like a panel always fading in from invisible.
Each value has a mode dropdown beside it, which says what the number you typed means:
| Mode | Means | Example |
|---|---|---|
Absolute |
Exactly this value | Alpha Absolute 0 = fully transparent |
Baseline |
The resting value, plus this | Scale Baseline 0 = its normal size. Position Baseline (0, -50) = 50 below where it normally sits |
Current |
Wherever it is when the step starts, plus this | Position Current (100, 0) = 100 to the right of wherever it is now. Only on To, and only when From is off |
The resting value is how the object was set up in the scene, captured when the game starts (before anything animates).
Tip
Use To: Baseline 0 for anything that should land back on its normal state. It lands in exactly the same place every time, however many times you Show and Hide, and if you later rearrange the scene, the animation follows automatically. Hard-coded Absolute positions don't.
Hover a mode dropdown for a reminder of what its options mean.
Under the hood
- The resting value is captured at
Awake. If you deliberately move an element while the game runs and wantBaselineto follow it, callCaptureBaseline()(not while one of its animations is running). -
Currenton To is DOTween's relative mode (SetRelative). - The From dropdown doesn't offer
Current. Older data could still have it there, where it never meant "an offset from the start": it makes the step ignore its From value entirely, exactly like the button readingTO. A step that already has it keeps showing it, with a tooltip saying so, and nothing is rewritten. - In code the FROM / TO button is the
UseFrombool.
This setting is on each animation, on by default. Leave it on unless you know why you want it off.
When it's on, every step with a From jumps to its From value the moment the animation starts, even steps that have a delay. When it's off, a delayed step keeps its current value until its turn comes.
Why it matters: picture a title that fades in from invisible after a 0.5 second delay. With this off, the title sits fully visible for half a second, then snaps to invisible and fades in. That flash is almost never what you want.
The record button at the end of every From and To row copies what the object looks like right now into that row. Drag an object where you want it, click, and the step lands there. It works for positions, sizes, scale, rotation, alpha, colours and material values.
It stores whatever the row's mode needs, so the step always ends up exactly where the object was:
| Mode | Stored |
|---|---|
Absolute |
The value as it is |
Baseline |
The difference from the resting value |
Current |
The difference from where the step starts |
For Baseline and Current, pose the object inside a preview, the same way Unity's Animation window records keys:
- Press Reset (or Play) on the animation. See Previewing.
- Select the object, and drag, resize, recolour or rotate it.
- Select the player again and click the record button on the row.
- Press Stop and Restore. The object goes back to its resting state, and the value you recorded stays.
Outside a preview, those two buttons are greyed out: wherever the object sits is its resting value, so the difference would always be 0. Absolute works any time, but outside a preview the object stays wherever you dragged it.
Under the hood
- Selecting the object you're posing doesn't end the preview. It keeps running while the selection is on the player, its Animation Set, or anything it animates, and ends once the selection moves anywhere else.
- Rotation is read as the nearest angle to zero, so a turn to
-10isn't copied as350and spun the long way round. - On a Custom Property step, the button only records
Absolute: there's no resting value for an arbitrary script member to measure against in the preview.
Punch and shake steps have no From or To. They show a strength instead, and always settle back where they started. Set Active and Play Sound have their own fields.
Installation
Code API
Basic usage
Advanced usage
- Punch and Shake
- Sizing a RectTransform
- Movement Paths
- Sound
- Custom Property
- Material and Shader Properties
- Stylised Motion
- Interrupting and Chaining
- Mirroring
- Copy and Paste
- Animation Sets
- Scene Gizmos
Nitty-gritties
Warnings and Troubleshooting