đŠī¸Flyby
Create flight paths based on destination and trajectory
Last updated
Create flight paths based on destination and trajectory
Last updated
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.
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.
To add Flyby, right-click on the object in the Timeflow view and select:
Add Automation > Flyby
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.
The keyframe may be selected, moved, and included in edit operations, however cannot be deleted nor can any new keyframes be added to the Flyby channel.
To generate a path that supports multiple keyframes, see Motion Path.
Select the game object to view the Flyby settings in the Inspector view.
Sets the anchor position and time by which the path is generated.
Position is defined in local coordinates.
The position remains fixed (to the start, end, or midpoint depending on the mode selected) no matter what changes are made to velocity or heading. This anchors the path at the specified position and time making adjustments much easier.
Generates a path that passes thru the Flyby Position at the designated time.
Flyby mode is best suited for objects that need to meet at a specific point or cross another object. For example, use this to make objects pass by or in front of the camera.
Generates a path beginning at the designated time from the Start Position.
This mode is best for paths that require starting at a specific time and place, such as an airplane taking off or a ship leaving a dock.
Generates a path arriving at the End Position at the designated time.
Use this mode to animate objects to a specific location with generated animation leading up to it. This mode is best for objects that animate up to a point and stop or hand off to other animation channels.
Specifies the time which correlates directly to the keyframe on the channel. How time is used depends on the Positioning Mode as explained above.
Sets the base duration used for calculating the motion path given the velocity and heading.
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.
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.
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.
Sets the overall rotation of the whole path. Use orientation to alter the direction and/or pivot the entire path around the target position.
Orientation does not change the object rotation, only the path, so may result in misalignment. To orient the entire path and object together, use a parent object to rotate and place the path.
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.
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.
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.
While it may be tempting to animate the Heading (which is possible) it will not produce the results of steering an object as you might expect. Instead, use a 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.
Note that the selected input channel must be enabled and active to function.
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.
Any animation or behavior channel could potentially be used as rotation input.
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.
Use Time Offset to look ahead or lag behind the actual rotation of the object. This may be for subtle or accentuated for effect.
Also see Time Offset for channels and objects.
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.
Lower the steering value to reduce the curviness of a path, or set a higher value (up to 2) to make path curves more eccentric.
Determines the speed of the object, affecting the overall distance the path covers.
Sets a fixed velocity maintained throughout the animation.
Use Constant velocity for trains and planes and other Flybys that don't need any variation in speed.
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.
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.
Negative velocity values are allowed and result in objects traveling in reverse. In the generated motion path this appears as a hard angle where the object changes direction.
This is the point at which velocity is 0, as it transitions from a positive to negative value. For more control over velocity, see Velocity Channel below.
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.
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.
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).
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.
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).
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.
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.
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.
If the inherited scale is non-uniform this may initially appear to squash the motion path, but as soon as the vector path is rebuilt it corrects itself to uniform scale. This is due to the way paths are constructed in world space and converted back to local space. Flyby still functions but this is an odd situation best to avoid.
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.
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.