- Home /
InputField null refrence exception
hi guys
Im adding an InputField to my gui, its build somthing like this
ive got canvas->menu->emptygameObject->InputField I cant see the placeholder and when Im trying to run and enter input into it, I get null refrence exception:
UnityEngine.TextGenerator.get_characterCountVisible () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/GUIElementBindings.cs:552) UnityEngine.UI.InputField.GenerateCursor (System.Collections.Generic.List`1 vbo, Vector2 roundingOffset) (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/InputField.cs:1620) UnityEngine.UI.InputField.OnFillVBO (System.Collections.Generic.List`1 vbo) (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/InputField.cs:1591) UnityEngine.UI.InputField.UpdateGeometry () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/InputField.cs:1533) UnityEngine.UI.InputField.Rebuild (CanvasUpdate update) (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/InputField.cs:1501) UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/BuildAgent/work/d63dfc6385190b60/Extensions/guisystem/guisystem/UI/Core/CanvasUpdateRegistry.cs:103) UnityEditor.Undo:Internal_CallWillFlushUndoRecord() how can i solve this thanks in advance GalNullReferenceException: Object reference not set to an instance of an object
Answer by galshal · May 10, 2015 at 10:22 AM
it seems that the problem was that on the gameObject that contains the inputfield.
on that gameobject I had vertical layout group, an it seems that it blocked the input field, removing the layoutgroup solved the problem.
Your answer
![](https://koobas.hobune.stream/wayback/20220613195204im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Input Field problem (Unity 4.6 UI) on LG G3 Android device 1 Answer
Change navigation keys for UI at runtime 1 Answer
Accessing Standalone Input Module Data 0 Answers
How can I block Copy Paste from Input Field? 3 Answers
UI slider "End slide" event 3 Answers