Give Page Feedback | API

Cell Visual Transition Controllers - Position Transitioner

The Position Transitioner performs transitions by manipulating the position value of transforms. Typically it is only necessary to move a single component value (x, y, or z) to achieve the effect you want, however you can manipulate as many as you want.

Creating A Position Transitioner Component

You can add this component by selecting a game object and then selecting from the Top Menu Bar:

Component -> Deep Space Labs -> -> SAM -> Visual Transition Controllers -> Position Transitioner

Adding A Position Transitioner Component From The Top Menu Bar GIF

or by selecting a game object and using the Add Component menu via its inspector:

Component -> Deep Space Labs -> -> SAM -> Visual Transition Controllers -> Position Transitioner

Adding A Position Transitioner Component From Add Component Menu GIF

How It Works

For each instance, you can specify a Change In Position From Invisible To Visible value. This change is applied to transforms when transitioning World Cells/Asset Chunks from the Invisible State to the Visible State. The inverse of this value is used for transitioning from the Visible State to the Invisible State.

For example, if a transform has a position of (10f, 20f, 33f) while in the invisible state, and a Change In Position From Visible To Invisible value of (100f, 300f, 200f) is set, the position of the transform will go from (10f, 20f, 33f) to (110f, 320f, 233f) over the course of the transition.

Conversely, when transitioning this same transform from the visible state to the invisible state, the scale of the transform will go from (110f, 320f, 233f) to (10f, 20f, 33f).

Benefits

The Position Transitioner offers a nice visual effect, though it is typically more suited for a stylized game where such a zany effect would not be out of place.

Curve Values Outside of 0/1

More than any other Transition Controller, with the Position Transitioner you may wish to use Animation Curve values less than 0 and/or greater than 1. For instance, you can use a Make Visible Curve where the value rises slightly above 1 right before t = 1, which will result in a sort of bouncing effect.

Reusing The Position Transitioner

While you can use the Position Transitioner on multiple World Groupings, keep in mind that each Position Transitioner instance only allows you to specify a single change in position value. Fortunately, a single value is usually sufficient for most objects, though in some cases you may want the movement direction different for different objects.

You may also need different Transition Time or Animation Curves depending on the objects you are moving.

What Transforms To Use

Each World Cell you need to transition will have one or more Asset Chunks to move. However, in some cases moving the Asset Chunk directly does not make sense, such as when the chunk is just an empty parent and its children are individual scene assets.

In these instances, enabling the Transforms Stored In Children option will tell the Position Transitioner to move all first level children of each Asset Chunk rather than the Asset Chunks directly.

Transition Time Variation

If you set this setting to 0, the transforms belonging to the input World Cells will all have the same transition time (i.e. the transitions will be completed at exact same moment).

In many cases (more so than with the Scale Transitioner) this may not be visually appealing, and in those cases you can apply a small variation to the Transition Time via this setting. The value you specify is subtracted from the Transition Time to get a minimum possible transition time, and then added to the Transition Time to get a maximum possible transition time.

When performing Non LOD Transitions, every transform is assigned a random value between these two ranges for their transition time.

When performing LOD Transitions, it's assumed that the transforms from the old LOD have matching transforms on the new LOD. Since there is no way to easily determine which Transforms need to match, the Transitioner takes a conservative approach and gives every Transforms on each Transition From Cell and Transition To Cell the same Transition Time (though this time is still a random value between the range specified above).

Basically, transforms belonging to the same Cell are given the same transition time.

The Transitioner uses the System.Random class to randomly choose the final transition times. Use the Random Seed setting to control the randomization.