- Home /
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: - but when it is moving, it actually very consistent.
Can anybody explain this behavior?
Answer by Casiell · Dec 03, 2019 at 03:10 PM
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.
Your answer
Follow this Question
Related Questions
Velocity value changes way to drastically when position quickly changes 0 Answers
force.normalized * magnitude 1 Answer
Make rigidbody slower not stop after hit kinematic rigidbody 1 Answer
Quaternion changes Vector3 magnitude? 1 Answer
Operator cannot be used with left hand side of type.... 1 Answer