This is an old revision of the document!
Controllers
Controllers are used to align or move GameObjects to Curvy Splines and Curvy Generator data like extrusion volumes or paths.
- Spline Controller: Use the Spline Controller to align or move GameObjects to Curvy Splines.
- Path Controller: This controller works with Curvy Generator Paths
- Volume Controller: This controller works with Curvy Generator Volumes
Here are the main parameters of the controllers:
General
Update In
Determines when the controller is updated: Update, LateUpdate or FixedUpdate
Spline/Path/Volume
The source object the controller will follow
Use Cache
Spline Controller only.
Whether to use cached values when appropriate. Cached values are less precise but faster to use.
Position
Position Mode
Whether the position is a world unit (absolute) distance or relative distance. Relative positions are values from 0 to 1. For splines, relative position is the TF while for paths and volumes it is the ratio of the total length.
Position
The position, using the above mode
Cross Position
Volume Controller only.
This section defines the lateral position:
Cross Range
Defines the range within the cross section the controller uses. The base point (the point '0' refers to) can be altered by using Shift.
Cross Position
Defines the position within the defined Cross Range
Cross Clamping
Defines what to do when trying to move over the defined range
Move
Move mode
Determines whether the speed uses absolute or relative distances. See Position Mode for more details about absolute and relative distances
Speed
The speed of the movement
Direction
The direction of the movement
Clamping
Determines what to do when the source's end is reached:
- Clamp - controller will stop
- Loop - controller will start over at the opposite side
- PingPong - controller switches direction
Play automatically
When enabled, the controller will start playing when entering the Play Mode.
Connections handling
Spline Controller only.
This allows you to specify how a Spline Controller should move when reaching a Connection. You can set one of the following behaviors:
- Use Current Spline: the controller will continue moving on the current spline as if there were no connections.
- Use Follow Up Spline: the controller will continue moving on the spline containing the Follow Up if there is any, otherwise will continue moving on the current spline.
- Use Random Spline: the controller continue moving on one of the connected splines, chosen randomly.
- Use Follow Up otherwise Random: the controller will continue moving on the spline containing the Follow Up if there is any, otherwise will continue moving on one of the connected splines, chosen randomly.
- Use Custom behavior: define your own connected splines selecting logic. You can do that by setting an instance of a class inheriting from ConnectedControlPointsSelector.
Allow direction changes
When enabled, this allows the controller to change its movement direction. If moving on a Follow Up, it will use the Follow Up heading. If moving on a random connection, it will change direction to backward if it is a spline's end, or forward if it is a spline's start.
Reject divergent splines
Whether splines that diverge from the current spline with more than a specific angle should be excluded from the randomly selected splines
Reject current spline
Whether the current spline should be excluded from the randomly selected splines
Orientation
The controller defines the object's rotation by aligning a Source vector (from the controller's source) with a Target vector (from the controller's GameObject)
Source
Determines the source position:
- None - The rotation is maintained.
- Tangent - the tangent (direction) is used
- Orientation - orientation (Up-Vector) is used
Target
Determines the rotation axis to align the above value to
Ignore direction
Available only if Source is different than None.
If enabled, the orientation ignore the movement direction. If not, when the controller is moving backward, the orientation flips direction.
Damping Direction time
Adds a smooth damping to the Tangent/Direction vector with the specified duration
Damping Up
Adds a smooth damping to the Up/Orientation vector with the specified duration
Offset
Available only if Source is different than None.
Applies an offset (lateral movement) on the GameObject's position, based on the Up/Orientation vector of the source.
Offset Angle
The Angle (-180 to 180) starting from the Up vector, defining the direction to offset with
Offset Radius
The distance to offset with
Compensate Offset
If enabled, the controller speed will be modified to take into consideration the longer or shorter distance to travel due to the offset
Events
You can react to certain events by adding a handler to the following UnityEvents:
OnInitialized
Available for all controllers
Called when the controller is initialized. You usually don't need to wait for the controller to initialize before setting its properties.
OnControlPointReached
Available for SplineController and UITextSplineController only
Called when moving over a Control Point
OnEndReached
Available for SplineController and UITextSplineController only
Called when the end (or start) of the source spline is reached
OnSwitch
Available for SplineController and UITextSplineController only
Called when switching between splines.
Preview
Lets you start and stop a preview of the movement in Edit Mode