🛩️Flyby

Create flight paths based on destination and trajectory

Flyby generates a motion path procedurally based on either a starting position, destination, or midpoint reached at a specific time. The path may be linear with a fixed heading or using an object's rotation to create all sorts of curves and spirals, which would otherwise be difficult to achieve using a Motion Path or other means.

An example Flyby path displayed in the Scene view. The path is auto-generated from the object's rotation and velocity.

Flyby does not generate rotation

Rotation may be used as input or ignored by Flyby, but it does not directly apply rotation. Flyby sets position only and expects rotation to be handled by other animation channels. To create rotation from a generated path, see Auto Rotate.

Flyby Channel

Flyby initially has 1 channel with a single special type of keyframe at the target time. The duration of the flyby is indicated by the bar extending from the keyframe, which may either be centered, before, or after depending on the mode selected.

When a new Flyby instance is added, its keyframe is set to the current time.

To generate a path that supports multiple keyframes, see Motion Path.

Flyby Editor

Select the game object to view the Flyby settings in the Inspector view.

Default settings for Flyby.

Positioning Mode

Sets the anchor position and time by which the path is generated.

Use the Position Mode drop-down menu to select 1 of 3 modes, described below.

Position is defined in local coordinates.

Flyby Position

Generates a path that passes thru the Flyby Position at the designated time.

The duration is centered on the target time, leading into and out of the flyby position.

Start Position

Generates a path beginning at the designated time from the Start Position.

The path starts at the specified time, animating from there for the duration.

Destination Position

Generates a path arriving at the End Position at the designated time.

The path ends at the specified time, animating the specified duration up to that point.

At Time

Specifies the time which correlates directly to the keyframe on the channel. How time is used depends on the Positioning Mode as explained above.

Duration

Sets the base duration used for calculating the motion path given the velocity and heading.

Hold In / Out

When enabled, Flyby holds the transform position values outside of the active duration: before the start (Hold In) and after the end (Hold Out). Otherwise if disabled, Flyby is bypassed does not affect the object before/after the duration. This is primarily used to prevent Flyby from overwriting channels before it, to allow another Flyby or other behavior to have full control.

Flyby 1 has disabled Hold Out while Flyby 2 has disabled Hold In, so the two meet without overwriting one another.

Hold In and Hold Out are depicted in the Track View (as shown above) with a ghosted region extending before and after the duration bar.

Channel Order

Note that channels are processed in the order listed and may result in one channel overwriting others before it. Whether the list displays top-down or first-to-last can be changed in the Timeflow Preferences.

Orientation

Sets the overall rotation of the whole path. Use orientation to alter the direction and/or pivot the entire path around the target position.

Direction

Determines the heading to generate the motion path from. The first six options listed are cardinal directions for creating simple linear paths along an axis (in local space), as shown below.

Flyby generates a straight motion path along the heading direction selected.

Reverse

Enable this to flip the direction of travel for the entire path. Toggle Reverse to correct an object traveling backwards.

Reverse flips the approach direction of the object and may have result in mirroring the path spatially.

Custom Direction

Select this mode to enter a specific fixed direction based on a vector heading. This expects a normalized value (adding up to 1) though any value may be used.

The heading is a direction along each axis, not a rotation value.

Rotation Channel

Generates a motion path using an input channel for rotation to curve the path. This pre-calculates the path by reading the full animation data and applying it over time, relative to the target Position and Positioning Mode selected.

Any channel that animates rotation may be used, either single attribute or combined.

As an example, Tween has been applied to Local Rotation Y to create a simple oscillating movement from -90 to 90 degrees.

Using this rotation as the input channel for Flyby results in a S shaped curve, following the rotation of the object. Randomization could be added to Tween for more variability, or a keyframed animation channel could be used instead for more control.

Flyby path generated from Tween rotation channel.

Any animation or behavior channel could potentially be used as rotation input.

Time Offset

Shifts the input channel forward or backward in time. If the value is 0, the rotation channel aligns to the Flyby channel as they appear in the Timeflow view, accounting for local and world offsets on each of the channels and objects.

When the flyby duration extends beyond the time of the input channel, the path flattens out straight, as shown below. This isn't usually a problem since it is likely outside of the timeline. However, if this is encountered it could be fixed using time offsets.

Also see Time Offset for channels and objects.

Steering

Controls how much rotation affects path curving. The default value is 1, which means every degree of rotation is represented in the curve 1:1.

Velocity Mode

Determines the speed of the object, affecting the overall distance the path covers.

Constant

Sets a fixed velocity maintained throughout the animation.

Start to End

Generates a velocity curve with a beginning, middle, and end. This spans the flyby duration the same way no matter which positioning mode is used.

An example where the object starts from a stand still (0 velocity), accelerates to 10 units per second, and then comes to full stop at the end.

Enable Ease In Out for smooth quadratic interpolation, or disable it for linear interpolation.

When using Flyby mode, use the Midpoint velocity to set the speed of the object at the flyby position. This can be a value of 0 to come to a full stop. However, to have more control over the timing it may be better to use Animation Curve or Velocity Channel.

Animation Curve

Uses a Unity Animation Curve to map the velocity over the duration of the path.

The Velocity value is multiplied by the curve.

Click in the Velocity Curve box (green line above) to open the curve editor. Use one of the presets at the bottom or create your own.

The curve represents the velocity over the full duration of the path.

Velocity Channel

This method of setting velocity offers the most control with full curve editing in the Timeflow view.

When this mode is selected, a new Velocity channel is automatically added.

Add keyframes to the Velocity channel and/or use Channel Link.

Velocity is a standard keyframe channel and can be used as such, including the ability to link it with other channels and full curve editing and looping capabilities. The velocity is measured in world units and controls the speed of the object throughout the path (units per second).

The velocity channel may have any number of keyframes and use of all keyframe/curve options.

Gizmos in the Scene View

When the game object is selected, Flyby displays its motion path in the Scene view. The position and orientation of the path may be edited using the gizmo handles.

Enable Stay Visible to keep the path displayed no matter if selected or not. However, the move and rotation handles are only displayed for the selected object.

Move Tool

When the Move Tool is selected (in Unity's main toolbar) the Flyby position may be edited using the position handle, as shown below. This works the same as a regular position handle, but sets the Flyby Position, rather than the transform position (which is determined by path interpolation).

Click and drag the position handle to move the entire Flyby path, anchored at the Position.

Rotate Tool

Switch to the Rotate Tool to adjust the path Orientation. This affects the overall direction of the path, however does not rotate the object. To move and rotate a whole flyby path and object at once, see the tips below on parenting.

Further Possibilities

With the power of simple keyframing and combining Flyby with other generative behaviors such as Tween, it's possible to create unlimited variations with complex results quickly and easily.

Using Tween to randomize rotation and looping Velocity curve to quickly create a complex path.

Using Parenting

Flyby works with hierarchical offsets, making it possible to move, rotate, and scale the entire path with the object. Add parent objects as needed to separate and layer transforms.

Avoid Non-Uniform Parent Scaling

Using Multiple Flybys

Apply more than 1 Flyby to an object to create stack animations end to end or spaced out in time.

The channel order depends on the setting the Timeflow Preferences.

When using multiple Flybys, arrange the channels in the order desired.

Mu

Last updated