State Animator

Flexalon Animator animates an object between named states, such as Hidden and Visible, or Hover and Press. Use it for entrance effects, hover and press feedback, and transitions that combine position, rotation, scale, size, and properties of other components, like a material's color. To simply follow layout changes smoothly, see Lerp and Curve Animators.

Animate an item

  1. Add Flexalon Animator to an item in your layout. Use only one animator per item.
  2. Set up the Hidden and Visible states. For an entrance, give Hidden a smaller scale or an offset position, and leave Visible at the layout's values.
  3. In each state, add tracks for the properties you want to animate, and set their keyframes and easing.
  4. Set the timing and easing of each transition between states.

If the item also has a Flexalon Interactable, the animator switches to the Hover, Press, and Drag states as the user interacts with it. Add tracks to those states for effects like a card that lifts when you point at it. To change state from a script, call StartTransition("Visible").

Flexalon Animator Options

Flexalon Animator inspector showing the Press state of a tile
State DefinitionsThe states the object can be in. Click a state to see the tracks it plays.
TracksWhat the selected state animates: position, rotation, scale, size, or a property of another component, such as a brightness value. Click Add Track to add one.
TransitionsThe timing and easing used when changing from one state to another.
Stagger OrderWhen a Flexalon Animator Driver uses Custom Order, animators with lower numbers start first.
Interpolate Layout ChangesOff by default, so the object jumps to its new place when the layout changes. Turn it on to glide there instead.
Interpolation SpeedHow quickly the object glides to its new place.
Separate InterpolationsChoose which of position, rotation, scale, and size glide, each with its own speed.
Interpolate In World SpaceOn by default, so the object glides smoothly even when its parent moves. Turn it off for items that should move along with their parent, such as items in a Scroller.

Expressions

A position keyframe can be a fixed value, a random value between a minimum and maximum, or an Expression. Expressions calculate the position from the size of the object, its parent, the canvas, or the screen, so the same animation works at any size. For example:

  • parent.width / 2 moves the object by half its parent's width.
  • screen.bottom - self.top - 40 starts the object just below the bottom of the screen.

You can use self, parent, canvas, and screen, each with width, height, depth, the center x, y, and z, and the edges left, right, bottom, top, back, and front. Combine them with + - * /, parentheses, min, max, and clamp.

Animate a group

Add Flexalon Animator Driver to the parent to play its children's transitions together, one after another. Call driver.TransitionTo("Visible") to play the group.

Flexalon Animator Driver Options

Flexalon Animator Driver inspector
ViewportOptional. Children stay Hidden until they enter this viewport, then play their entrance. Useful for items that appear as you scroll.
Visible TriggerPlay the entrance every time a child enters the viewport, or only when scrolling forward.
TypeThe order children start in: by child order, along an axis, around an axis, by distance from a point, or by each animator's Stagger Order.
Sweep DurationThe time from the first child starting to the last. Child order uses the time between each child instead.
ReverseStart from the other end.
Point / AxisThe point or axis children are ordered by, in this object's space unless the matching World Space option is on.

The AnimatorInteractionSample and AnimatorInteractionUISample scenes show hover, press, and drag states.

Animator API ยท Animator Driver API