The Flexalon Constraint component positions its gameObject relative to a target, which can be any other gameObject. The constrained object or the target can also have layout components, which provides a powerful way to combine layouts together.
In this example, we have a circle layout of blue spheres and three other meshes. The circle layout is constrained to the position and size of the mesh that is clicked on.
Let's break it down. First, the circle layout is configured to set its diameter to its width using the 'Use Width' property. Then, the Flexalon Object on the circle layout sets its width to fill 120% of the available space. What is the available space? When an object is constrained, the available space is the size of the constraint target.
Finally, the circle has a Flexalon Constraint component. A simple script simply changes the constraint target when the user clicks. Flexalon moves the circle to the new constraint target, and its width and diameter get bigger to match 120% of the target.
|Target||Which gameObject to constrain to.
The position depends on the Align and Pivot options (see below).
The rotation is set to match the target's rotation.
The available space is set to match the target's size. Set the width, height, and depth properties on the Flexalon Object Component to Parent to match the target's size.
|Align||Determines how each axis aligns to the target's box.|
|Pivot||Determines how each axis aligns to this object's box.|
© 2022 Virtual Maker Corporation