Question by
martinhodler · Mar 31, 2017 at 03:08 PM ·
unity 5guigridscrollview
GridLayoutGroup issue after loading scene and dynamically adding Instances
Hi,
I would like to dynamically fill a GridLayoutGroup in a ScrollView with instantiated GameObjects (Buttons). This works great if I start the game directly in the scene where the ScrollView is placed.
But if I load this scene from another one the GridLayoutGroup breaks and displays a red cross. So, I selected the GameObject with the broken GridLayoutGroup and Unity fills up my Console with the following 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()
Can someone help me? Thanks!
Comment
Best Answer
Answer by martinhodler · Apr 04, 2017 at 04:26 PM
After I changed the Vertical Scrollbar > Visibility of the Scroll Rect component from Auto Hide And Expand Viewport to only Auto Hide it all works fine.