Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
documentation:controllers [2018/01/04 12:55] – external edit 127.0.0.1 | documentation:controllers [2018/06/07 17:32] – _Aka_ | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Controllers ====== | ====== Controllers ====== | ||
Controllers are used to align or move GameObjects to Curvy Splines and Curvy Generator data like extrusion volumes or paths. | Controllers are used to align or move GameObjects to Curvy Splines and Curvy Generator data like extrusion volumes or paths. | ||
- | + | | |
- | The following controllers are shipped with Curvy: | + | |
- | + | | |
- | | + | Here are the main parameters |
- | * [[#Path Controller]] | + | |
- | * [[#Volume Controller]] | + | |
- | + | ||
- | ===== Spline Controller ===== | + | |
- | Use the Spline Controller to align or move GameObjects to Curvy Splines. | + | |
- | ===== Path Controller | + | |
- | This controller works with Curvy Generator | + | |
- | ===== Volume Controller | + | |
- | This controller works with Curvy Generator | + | |
- | + | ||
- | ===== Reference ===== | + | |
- | All controllers share the same base parameters: | + | |
====General==== | ====General==== | ||
==Update In== | ==Update In== | ||
Determines when the controller is updated: Update, LateUpdate or FixedUpdate | Determines when the controller is updated: Update, LateUpdate or FixedUpdate | ||
- | ==Space== | + | ==Spline/ |
- | Whether to use world space or the object's local space | + | The source |
==Use Cache== | ==Use Cache== | ||
- | Whether to use cached values when appropriate or not | + | //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 | ||
+ | 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==== | ====Cross Position==== | ||
- | //VolumeController | + | //Volume Controller |
- | This section defines the lateral | + | This section defines the lateral position: |
- | : | + | |
== Cross Range == | == Cross Range == | ||
Defines the range within the cross section the controller uses. The base point (the point ' | Defines the range within the cross section the controller uses. The base point (the point ' | ||
- | == Cross Initial | + | == Cross Position == |
- | Defines the initial | + | Defines the position within the defined Cross Range |
== Cross Clamping == | == Cross Clamping == | ||
Defines what to do when trying to move over the defined range | Defines what to do when trying to move over the defined range | ||
- | |||
- | ====Position==== | ||
- | This section defines the starting position | ||
- | ==Position Mode== | ||
- | Whether the starting position is entered in world unit distance or relative. | ||
- | <note important> | ||
- | ==Initial Position== | ||
- | The starting position, using the above mode | ||
- | |||
- | |||
- | |||
====Move==== | ====Move==== | ||
==Move mode== | ==Move mode== | ||
- | Determines | + | Determines |
- | * **Relative** - using either TF (splines) | + | |
- | * **AbsoluteExtrapolate** - using (faster) extrapolated distance (splines) | + | |
- | * **AbsolutePrecise** - using calculated distance | + | |
==Speed== | ==Speed== | ||
- | The speed, using the above mode, or delta (if animated) | + | The speed of the movement |
- | <note important> | + | ==Direction== |
+ | The direction of the movement | ||
==Clamping== | ==Clamping== | ||
- | Determines what to do when the source' | + | Determines what to do when the source' |
* **Clamp** - controller will stop | * **Clamp** - controller will stop | ||
- | * **Loop** - controller will start over at the opposite | + | * **Loop** - controller will start over at the opposite |
* **PingPong** - controller switches direction | * **PingPong** - controller switches direction | ||
==Play automatically== | ==Play automatically== | ||
- | When enabled, the controller will start playing | + | When enabled, the controller will start playing |
- | ==Adapt on change== | + | ====Connections handling==== |
- | Internally, all controllers store the position relative (TF or percentage). So if you dynamically change the length of the source (e.g. by adding Control Points to a spline), the controlled object " | + | //Spline Controller only.// |
- | ==Animate== | + | This allows you to specify how a Spline Controller should move when reaching a [[.: |
- | If enabled, | + | * **Use Current Spline**: |
- | ==Animation== | + | * **Use Follow Up Spline**: the controller |
- | The animation curve to apply. X axis reflects | + | * **Use Random Spline**: the controller continue moving on one of the connected splines, chosen randomly. |
- | ==Time Scale== | + | * **Use Follow Up otherwise Random**: |
- | The duration in seconds | + | * **Use Custom behavior**: define your own connected splines selecting logic. You can do that by setting an instance of a class inheriting from ConnectedControlPointsSelector. |
- | ==Single Shot== | + | ==Allow direction changes== |
- | If enabled, | + | 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' |
- | ==Reset On Stop== | + | ==Reject divergent splines== |
- | If enabled, | + | 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 | ||
====Orientation==== | ====Orientation==== | ||
- | ==Orientation Mode== | + | The controller defines the object' |
- | Determines | + | ==Source== |
- | * **None** - no rotation is applied | + | Determines |
+ | * **None** - The rotation is maintained. | ||
* **Tangent** - the tangent (direction) is used | * **Tangent** - the tangent (direction) is used | ||
* **Orientation** - orientation (Up-Vector) is used | * **Orientation** - orientation (Up-Vector) is used | ||
- | ==Orientation Axis== | + | ==Target== |
- | Determines the rotation axis to apply the above value to | + | Determines the rotation axis to align the above value to |
- | ==Damping Direction== | + | |
- | Adds a damping to the Tangent/ | + | |
- | ==Damping Up== | + | |
- | Adds a damping to the Up/ | + | |
==Ignore direction== | ==Ignore direction== | ||
- | If enabled, | + | // |
- | < | + | If enabled, the orientation ignore the movement direction. If not, when the controller |
+ | ==Damping Direction time== | ||
+ | Adds a [[https:// | ||
+ | ==Damping Up== | ||
+ | Adds a [[https:// | ||
+ | ====Offset==== | ||
+ | //Available only if Source is different than None.// | ||
+ | Applies an offset (lateral movement) on the GameObject' | ||
==Offset Angle== | ==Offset Angle== | ||
- | The Angle (-180 to 180) starting from the Up vector, defining the direction to offset | + | The Angle (-180 to 180) starting from the Up vector, defining the direction to offset |
==Offset Radius== | ==Offset Radius== | ||
- | The distance to offset | + | The distance to offset |
==Compensate Offset== | ==Compensate Offset== | ||
- | If enabled, | + | If enabled, |
====Events==== | ====Events==== | ||
- | //(Spline Controller | + | You can react to certain events by adding a handler to the following [[https://docs.unity3d.com/ |
- | See [[.:controllers: | + | |
+ | ==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 | ||
+ | |||
+ | 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. | ||
+ | <note important> | ||
====Preview==== | ====Preview==== | ||
- | Lets you preview the movement in the editor! | + | Lets you start and stop a preview |