- Home /
Look rotation viewing vector is zero spam in editor
After upgrading my project to 5.5 I started getting this error spamming the console. It only seem to happen when I have a gui element selected and am in scale mode in the editor. When selecting the object i get the message a few times then if my mouse cursor is over the scene view the console is filled with the same message, slowing the editor down and making it nearly unusable.
I recreated a small part of my gui and it is not happening with the remade parts.
Here is the full message:
"Look rotation viewing vector is zero UnityEngine.Quaternion:LookRotation(Vector3, Vector3) UnityEditorInternal.Slider2D:CalcDeltaAlongDirections(Int32, Vector3, Vector3, Vector3, Vector3, Vector3, Single, CapFunction, Vector2, Boolean) (at C:/buildslave/unity/build/Editor/Mono/EditorHandles/Slider2D.cs:279) UnityEditorInternal.Slider2D:Do(Int32, Vector3, Vector3, Vector3, Vector3, Vector3, Single, CapFunction, Vector2, Boolean) (at C:/buildslave/unity/build/Editor/Mono/EditorHandles/Slider2D.cs:114) UnityEditor.DockArea:OnGUI()"
is that line referenced by the error, your code? C:/buildslave/unity/build/Editor/$$anonymous$$ono/EditorHandles/Slider2D.cs:279 If so, please post that code section to.
The LookRoatation is choking on the input it has been provided because in order to specify a direction with a vector, one must use a vector with a non-zero magnitude: in other words- ANY vector EXCEPT (0,0,0) will do. Since 0,0,0, does NOT indicate any particular direction to "look at": the error function throws the error message.
This is happening in editor not play mode. The message isnt even an error, just a debug.log from unity code.
Same issue here.
It seems like editing image in 2D mode, and the image is under the normal Transform (not RectTransform) hierarchy.
I move image under RectTransform hierarchy, and it works fine.
Answer by cfloutier · Dec 15, 2016 at 10:53 AM
It wasn't in play mode for me too, just in editor.
And the trouble occurred because the size of My canvas was Zero......
Thanks, it wasnt my canvas that was size zero but a panel that had all the guis children attatched to it that was the problem.
Thanks. This was so annoying for me! In my case, a Rect Transform was locked to 0 height and width because of a Horizontal Layout Group... I just made the $$anonymous$$ height and width of my Layout Element 0.1. $$anonymous$$aybe that can help someone out.
Thanks guys, just got that error too. Turned out child gameobject of my UI (customization panel) had height 0, turned it to 0.01 - error is gone!
Thx for the tip! It also happens in Play mode, for instantiated prefab objects. Check your prefabs if they have width and height set to 0 by setting Anchor preset to middle-center. The width and height values are hidden if the Anchor preset is set to stretch-stretch
Answer by IgorAherne · Jun 09, 2017 at 03:57 AM
For me, the issue happening when I would select a LayoutElement
Turned-out that the parent Vertical Layout Group had anchors collapsed and the height of the blue rectangle (press T to view rec transform tool) was 0
So I added the content size fitter to that layout group (and set it to follow the preffered height), which fixed the issue
Your answer
Follow this Question
Related Questions
What is the proper way to link a loot table and an enemy ? 2 Answers
Editor rectanglecap or button with fill color? 0 Answers
Pink screen in editor and some games, why? 2 Answers
React on button down in Editor GUI 2 Answers
runInBackground in Edit Mode 0 Answers