I want to know the direction a spaceship is actually moving to, its path of motion. I am doing it like so
void Start() { prevPos = transform.position; } void FixedUpdate() { Vector3 currPos = transform.position; Vector3 motion = currPos - prevPos; Debug.Log("Current position: " + currPos + " Previous position: " + prevPos + " Difference: " + motion); prevPos = currPos; } The problem is that each frame the ship doesn't move too much, and the difference between currPos and prevPos (I'm guessing) is in the decimals (0.0530 for example). From what I read Vectors go up to 7 decimals, yet motion equals (0, 0, 0) most frames.
In the Debug above I get these results
Current position: (0, 0, 0.5) Previous position: (0, 0, 0.4) Difference: (0, 0, 0)