- Home /
Quaternion To Matrix conversion failed
Hi,, Getting error like this. Don't know why its coming.
Quaternion To Matrix conversion failed because input Quaternion is invalid {nan, nan, nan, nan} l=nan UnityEngine.GUIUtility:RotateAroundPivot(Single, Vector2) LineDrawer:DrawLine(Vector2, Vector2, Int32, Texture2D) (at Assets/Scripts/LineDrawer.cs:79) LineDrawer:OnGUI() (at Assets/Scripts/LineDrawer.cs:64)
Answer by Bunny83 · May 12, 2016 at 08:19 AM
Next time include your code that produces the error. As you can see you managed to create an invalid Quaternion (all four values are "NaN" - Not a Number). Such errors happens when:
Any value involved is already a NaN value. So the cause might be somewhere earlier in code
you pass in values which will cause a NaN value.
Since you use RotateAroundPivot there are two possible sources:
the angle passed to RotateAroundPivot is either NaN or +- infinity
any component of the passed Vector3 is either NaN or +- infinity
Keep in mind that a number divided by zero results either in + or - infinity
My guess is that the angle passed is the problem.
Your answer
Follow this Question
Related Questions
[Solved] GUI Error? 1 Answer
How to have OnGUI element in a OnTriggerEnter function? 3 Answers
Script attached to 'Object' in scene '' is missing or no valid script is attached. 5 Answers
Problem creating GUI.Window, Help please! 1 Answer
blackberry error (Author Id, etc...), no script added ye... 1 Answer