Why camera.velocity is not consistant?

Hello everybody,

I’m checking the camera.velocity on a VR camera.
The camera moves based on players’ head movement.

I want to get a single value from the vector3 which is the velocity. Debug.Log(mainCam.velocity.sqrMagnitude);

so I pass the Vector3.sqrMagnitude - which return the square length of this vector, HOWEVER, when my camera is idle, the value of the square length is not consistent and actually varies a lot:149515-velocty-behavior.png

  • but when it is moving, it actually very consistent.

Can anybody explain this behavior?

VR camera is hardly ever perfectly still. There will pretty much always be some minuscule movement, especially when headset is on users head.

Having said that, any value which ends in E-05 is basically equal to 0. It’s a float, so you should never, ever expect exact values.