đ§ŽAlign Children
A helpful tool for aligning objects and organizing children
Last updated
A helpful tool for aligning objects and organizing children
Last updated
This behavior provides bulk editing of child transforms to create arrangements of objects, useful both for scene setup and animation. It is also a useful behavior for motion graphics with the ability to apply relative offsets, incremental transforms, and adding randomization.
To add this behavior to an object, right-click the object in the Timeflow view and select from the context menu: Add Tool > Align Children
Enable this to automatically update the alignment of children upon any change, and to enable this behavior for animating. If disabled, updates are only applied when the Refresh button is pressed.
When Align Children is only being used for scene setup and not for animation, you may also set the Runtime Mode to Editor Only, so that the behavior is destroyed and has no effect during runtime.
This rebuilds the child object list. Only direct descendants of the current object are considered children. The child objects must remain parented to the current object to behave as expected.
Click the Gather Children button any time you have added or removed child objects to refresh the list.
Please beware that when using Relative Offsets, as described below, that re-gathering children will reset the original values. This may have unintended consequences so should be used carefully, otherwise you may have to manually reset objects to restore the desired starting position for each object.
Sets the random seed for applying the Randomize values. Each seed results in the same randomization each time transforms are processed, providing a random but predetermined result.
Click this button to randomly assign a new random seed to quickly create variations.
Animating Alignments
All of the properties listed below may be animated in Timeflow using keyframing or any behavior for dynamic positioning, however Auto Update must be enabled.
Each of the transforms (position, rotation, and scale) have similar settings and generally work in the same manner. You may enable each section as needed. The one key difference is that the scale settings also have a uniform setting, so objects can maintain their proportions.
Note that all transforms are applied in local coordinates.
If this box is checked, the transforms are applied in reverse order, starting with the last child. This has the effect of inverting the applied offset for each, and the randomization values applied.
When this checkbox is enabled (the default setting) it preserves each child's original local transform as the starting point, when all fields are set to 0. This is especially helpful to deconstruct objects or animate objects already arranged in a specific way.
As mentioned above, relative offset values are stored internally when children are first gathered when this component is applied, or whenever Gather Children is pressed. If you need to add children to an existing setup using relative offsets, make sure all fields are set back to zero and that the children appear in the original positions before pressing Gather Children to ensure their relative offsets are based on the correct placement.
When enabled, Each is applied so that the objects remain aligned to the center of the parent. This makes it easier to manage columns and rows centered on the parent transform.
This setting works in conjunction with Center to apply absolute values. Use this to apply symmetrical transforms from the center position.
This sets the base transform on each object, applying the same value to each.
Note that this applies to the local transform of each child object, not to the parent. You may still use the standard transforms on the parent object to move the group as a whole.
This applies incremental transforms to each child in order. This can be used to create stepped or offset transforms that increase or decrease over the list of child objects.
Applies randomization to each transform.
Each axis can optionally be locked if you wish to constrain alignment to only affect specific axes. This can be useful to prevent accidentally making changes to a certain axis and to allow other behaviors to control them.
This is a helpful tool to rename the children with a base name and numbers. This uses the current sorting of children in the hierarchy.
Align Children Example
Please refer to the example scene provided:
Assets/AxonGenesis/Timeflow/Examples/Scenes/Tools/AlignChildren.unity