Skip to main content
A Transition shows one child at a time, like a Solo. When the active child changes, a Transition script draws the change between the outgoing child and the incoming one, such as a crossfade, slide, or wipe. Transition scripts are different from Transition Condition Scripts, which decide when a State Machine moves between states.

Adding a Transition

1
Create a new script and select Transition as the type.
2
Add the script to your artboard the same way you add other scripts to your scene.
3
Add component instances as children of the Transition. Only component instances can be switched between. Other children stay in place.
Select the Transition and use Active in the Inspector to choose which child it shows. Changing Active plays the transition script. You can key or bind Active to switch children from an animation or a view model. The script only animates the change while the artboard is playing. In design mode, the Transition switches children instantly.

Using a view model list

You can also add children from a view model list. Select the Transition and use Source in the Inspector to bind a list. Each item in the list becomes an extra child the Transition can switch between, after the component instances you added in the Hierarchy.

Anatomy of a Transition script

New Transition scripts start with a crossfade:
  • changed runs when the active child changes. Reset your progress here.
  • advance runs every frame while the transition is running. Return false when it’s done, and the Transition goes back to drawing the active child normally.
  • draw draws the two children. Wrap each child:draw(renderer) in renderer state, such as opacity, transforms, or clipping, to build the effect.
See Transition and TransitionChild in the API reference for every field and method.