A simple controller to allow a GameObject to follow a path whilst optionally looking at a target object. More...
Public Member Functions | |
void | Awake () |
Validate initial state. | |
virtual void | Update () |
Called once per frame to update the owner object's transform. | |
virtual void | OnPathEndReached () |
Override this method to receive an event when this constraint reaches the end of the path. | |
virtual void | ResetPath () |
Resets the constraint to the beginning of the path. | |
virtual void | ResetPath (bool restart) |
Resets the constraint to the beginning of the path and optionally re-enables the path following behaviour from the start point. | |
Public Attributes | |
CurvePath | path |
The path on which to constrain this object. | |
Transform | target |
The transform to look at. | |
float | speed = 1.0f |
The speed at which to traverse this path. |
A simple controller to allow a GameObject to follow a path whilst optionally looking at a target object.
void PathConstraint.Awake | ( | ) |
Validate initial state.
virtual void PathConstraint.OnPathEndReached | ( | ) | [virtual] |
Override this method to receive an event when this constraint reaches the end of the path.
Reimplemented in PreviewCameraController.
virtual void PathConstraint.ResetPath | ( | bool | restart | ) | [virtual] |
Resets the constraint to the beginning of the path and optionally re-enables the path following behaviour from the start point.
virtual void PathConstraint.ResetPath | ( | ) | [virtual] |
Resets the constraint to the beginning of the path.
virtual void PathConstraint.Update | ( | ) | [virtual] |
Called once per frame to update the owner object's transform.
Reimplemented in PreviewCameraController.
The path on which to constrain this object.
float PathConstraint.speed = 1.0f |
The speed at which to traverse this path.
Transform PathConstraint.target |
The transform to look at.
If not specified the object will look along the path with its Z axis, with Y pointing up