Place On Path
Place an object on a motion path
Last updated
Place an object on a motion path
Last updated
This behavior places an object on a motion path, which may be used both as an editing feature when constructing scenes and to animate objects along or relative to a path.
Place On Path has 2 read-only channels outputting the final placed position and rotation.
Select the object to view its settings in the Inspector.
After making changes to a motion path, use Refresh All to update all instances of Place On Path to recalculate their placements relative to the path.
Select this mode to place an object on a Flyby path. The settings works the same as with a motion path.
A Path Provider is a type of component which implements custom path interpolation. When using the Splines package in Unity, this offers the ability to interpolate spline paths.
To setup a spline for use with Place On Path, add the Spline Path Provider script to the Spline Container. This can then be assigned as the Path Provider as shown above.
Be sure that your Spline Container and Place On Path are on different game objects.
For an example, see the scene:
Samples/Scenes/Automation/PlaceOnPath_UnitySpline
For more information see Unity Splines
Placement may use the full path, follow the current path time, or start from a specific node.
This is the default mode and interpolates along the entire path.
Placement is based on the current position of the motion path at the current time.
Use this mode to place objects on the motion path at the current time. If Every Frame is enabled, this animates the object along the path matching the original motion. Position and time offsets may both be used to offset the placement in time.
This mode places the object relative to a specific keyframe node along the path, maintaining its relative relationship even when the path has been modified or new keyframes added.
This is a useful method to keep objects aligned to a motion path while still being able to make changes to it. It can also be helpful to animate an object starting from a specific keyframe in the path.
Placement along the path is determined by both Position and Time. Both or either may be used to adjust placement.
Position: Interpolates along the path from start to end (normalized from 0 to 1).
Time: Applies an offset in seconds based on the path timing as it is animated in Timeflow.
Animating an object along a path using Position (animating from 0 to 1) allows objects to have their own independent velocity over the length of the path. Whereas using Time is relative to the motion path timing including velocity changes.
If enabled, interpolation wraps the start and end of the path in an endless loop, with no limits enforced on Position allowing endless interpolation (looping in cycles over the path). This works with any path regardless of whether the start and end points meet in 3D space.
Use Wrap for objects that traverse a path multiple times or for closed paths to interpolate continuously where the start and end meet.
These buttons are shortcuts to help with editing. Press Goto to jump to the set time in Timeflow. And press Get Current Time to assign the current time (from the playhead position in Timeflow) to the field.
Enable to match the motion path placement in world space, otherwise local space is used.
Using local coordinates, parent transforms may be used to replicate a path at a different scale and position. For example, this could be used to create a minified map in a HUD displaying the relative position of an object on a full scale path.
Each axis of position and rotation may optionally be locked to constrain placement on certain axes or a plane.
Applies a positional offset to the final placement of the object.
This option determines whether the positional offset is applied before or after the rotation is applied, which affects the final placement.
Applies temporal smoothing defined in seconds to the placed position. This may be used to smooth out bumps in the motion, however larger values can be used to create lazy following effects. The larger the smoothing value, the more the object may drift off of the path.
Selects the mode for calculating rotation.
None: Does not calculate rotation and only applies the Orientation value.
Interpolate: Matches the path's rotation over time.
Look Ahead: Calculates rotation by looking at the path ahead (in seconds)
Look At: Dynamically faces towards the specified object
When using the Look Ahead mode, the look ahead point may be applied to the position of the specified game object. This can be helpful to visualize the look at point, or as additional animation feature.
Applies rotational offset to the object.
Applies temporal smoothing to the overall placement. Set to 0 to disable.
Use Smooth Time for floating objects that don't require staying fixed to the path.
Place On Path is a useful tool when constructing scenes. It makes it easy to place objects along a hero or main camera path. If placements are related to specific path nodes, then those nodes can be moved in space and time and the placed objects updated to the new position.
During the prototyping stage of an animation, this is particularly helpful to make changes to the path, such as inserting more time or covering more distance, and being able to quickly update all associated object placements, rather than having to reposition each one by hand.
For common features, please refer to and .
By default, Place On Path updates every frame, however this may be changed in the .
To force an update, press the refresh button
Use this button to force refresh all instances of Place On Path currently in the scene. To refresh just this instance, press the button in the menu bar.
Assign the to use for placement. When the behavior is first applied it automatically locates the first Motion Path instance. This can be assigned manually by dragging and dropping a game object from the Hierarchy view.
To use this feature, enable on the Motion Path so that the path node objects are visible in the scene hierarchy (path nodes are game objects, initially hidden from the hierarchy view). To assign a node, drag and drop the game object into the MotionPathNode field above.
If you wish to prevent placed objects from updating automatically, use mode in the . When set, Place On Path only updates placement when the (or ) button is pressed.
When using Place On Path for scene building, the run mode may be changed to so that the component is automatically removed at runtime, helping to optimize performance while still preserving the setup for use in edit mode. This happens during OnAwake upon entering play mode or upon loading a scene at runtime.