Function Cursor.MoveWithTurningSpeed

MoveWithTurningSpeed (float time, float speed, float turningSpeed, ref Vector3 tangent)

Moves the agent along the path, stopping to rotate on the spot when the path changes direction.

Public
void MoveWithTurningSpeed (

float

time

The number of seconds to move forwards or backwards (if negative).

float

speed

Speed in meters/second.

float

turningSpeed

Turning speed in radians/second.

ref Vector3

tangent

The current forwards direction of the agent. May be set to the tangent property if you have no other needs. If set to something other than tangent, the agent will start by rotating to face the tangent direction. This will be replaced with the forwards direction of the agent after moving. It will be smoothly interpolated as the agent rotates from one segment to the next. It is more precise than the tangent property after this call, which does not take rotation into account. This value is not necessarily normalized.

)

Moves the agent along the path, stopping to rotate on the spot when the path changes direction.

Note

The cursor state does not include the rotation of the agent. So if an agent stops in the middle of a rotation, the final state of this struct will be as if the agent completed its rotation. If you want to preserve the rotation state as well, keep track of the output tangent, and pass it along to the next call to this function.