if (Single.IsNaN(myQuaternion.x) || Single.IsNaN(myQuaternion.y) || Single.IsNaN(myQuaternion.z) || Single.IsNaN(myQuaternion.w)) {
// Quaternion has NaN values
}
I am not sure.
In my script, I am rotating a transform to match a specific rotation or Quaternion value. I guess, for some reason which I have not picked up, the value of this target rotation, is occasionally missed.
What is really wierd is, I made some code adjustments last night and it started happening much more frequently. I added in a print(sphereRtn); just after the place where it should be assigned, now, it rarely happens.
I find it irritating how much you like it to talk about the issue and what you are experiencing. It is obvious that sphereRtn is the problem in your code. You know the cause, why do you try to resolve it somewhere else?