Velocity.zero

Hi Guys, I am using this code

var velocity = rigidbody.velocity;
Debug.Log(velocity);

//Look for no motion on the space ship
if(velocity == Vector3.zero){
Debug.Log("The ship is still");
}

to look to see if my ship is not moving, But it only seems to Print The Ship is Still the first time its not moving, and never again until it respawns. Does anyone have any idea why?

Yeah velocities can be very very small - use this instead:

if(velocity.sqrMagnitude < 0.01f) {  //Or some other value
 }

Click the “Collapse” button in the console.