Check object for motion

Is there a prebuilt function that checks if an object is in motion? A function that checks x,y,z tranform to tell if the object is in motion or at rest?

If not, any ideas on how to acomplish this task?



If you have a rigidbody, then you can do `Rigidbody.IsSleeping()` to check if your rigidbody is sleeping

If you are using a Character Controller, then checking to see if `CharacterController.velocity ==;`

Or, you can manually save a Vector3 every frame that remembers the last position. Something like:

function Update () {
     curPos = position;
     if(curPos == lastPos) {
         print("Not moving");
     lastPos = curPos;