Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

It seems I found a bug in label or input fields...

Discussion in 'Editor & General Support' started by Marzoa, Mar 31, 2015.

  1. Marzoa

    Marzoa

    Joined:
    Dec 2, 2012
    Posts:
    50
    I keep getting this error in Unity 4.6.3f1:

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index

    The stack just before that:

    System.Collections.Generic.List`1[UnityEngine.UICharInfo].get_Item (Int32 index) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    UnityEngine.UI.InputField.SetDrawRangeToContainCaretPosition (UnityEngine.TextGenerator gen, Int32 caretPos, System.Int32& drawStart, System.Int32& drawEnd) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:1487)
    UnityEngine.UI.InputField.UpdateLabel () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:1360)
    UnityEngine.UI.Graphic.SetVerticesDirty () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:100)
    UnityEngine.UI.Graphic.SetAllDirty () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:76)
    UnityEngine.UI.Graphic.OnRebuildRequested () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:375)
    UnityEngine.UI.Text.OnRebuildRequested () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Text.cs:528)
    UnityEngine.UI.GraphicRebuildTracker.OnRebuildRequested () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/GraphicRebuildTracker.cs:34)
    UnityEngine.CanvasRenderer.RequestRefresh ()

    I've the following structure:

    Canvas
    LabelPlayer1 <- Surprisingly this is an UI Label
    InputField <- Surprisingly this is an UI Input Field
    Enabled <- This is a checkbox, though it seems irrelevant for the matter
    LabelPlayer2
    InputField
    Enabled
    LabelPlayer3
    InputField
    Enabled
    LabelPlayer4
    InputField
    Enabled
     

    Attached Files:

  2. Marzoa

    Marzoa

    Joined:
    Dec 2, 2012
    Posts:
    50
    Tried a different approach (see attachment), but problem persists. It is worth to say that it does not happen always, and it seems to occur more often immediately after loading this scene from another one.
     

    Attached Files:

  3. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Strip your project down into something that is small, and send it in with a bug report. Post the bug number here, and I'll tell the QA team about your forum thread.
     
  4. holyjewsus

    holyjewsus

    Joined:
    Mar 7, 2011
    Posts:
    624
    I am now encountering this all of a sudden upon updating to latest installer as of today. 5.01f1, whats the bug number for this?
     
  5. ring

    ring

    Joined:
    Mar 14, 2013
    Posts:
    11
    I've been encountering this also in Unity 4.6.4f1
    It sometimes happens and sometimes doesnt during identical tests.