“Invalid Parameter because it was Infinity or NaN”
It is a floating point error. A number becomes infinity when you uhm, multiply by infinity. And more likely, a number becomes a NaN (not a number) when you divide it by zero. Check your code, you might have some divisions by zero.
Also, these things tend to happen when you try to get the rotation of normal using raycast or when you try to manipulate a quaternion without a value.
To check if a number is NaN, you have to do something like if (x != x)
. And if the condition passes, then you have got a NaN, because NaN is not equal to anything, even to itself.