Search Issue Tracker
Not Reproducible
Votes
5
Found in [Package]
1.4.11f2
Issue ID
UVSB-656
Regression
No
UnityEngine.UI.Selectable -> IndexOutOfRangeException: Index was outside the bounds of the array.
[Original Issue link|https://support.ludiq.io/communities/5/topics/5187-bolt-bug-unityengineuiselectable-indexoutofrangeexception-index-was-outside-the-bounds-of-the-array]
----
Hello,
I randomly get an error saying I need to rebuild the bolt unit options. And after that I get a bunch of these errors:
IndexOutOfRangeException: Index was outside the bounds of the array.
(wrapper stelemref) System.Object.virt_stelemref_class(intptr,object)
UnityEngine.UI.Selectable.OnEnable () (at C:/Program Files/Unity/Hub/Editor/2019.3.12f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Selectable.cs:493)
They happen on a new empty scene with just UI Button or Input Source for example.
If I revert the project to collab version, then build bolt unit options the error comes back.
-
chris_schubert
Dec 10, 2021 20:49
I get it most frequently when using TextMeshPro buttons.
My workaround:
[InitializeOnLoadAlways]
public class DummySelectable : Selectable
{
static DummySelectable()
{
if (s_SelectableCount < 0)
{
s_SelectableCount = 0;
}
}
} -
triangle4studios
May 06, 2021 03:08
Is Accompanied by this error:
IndexOutOfRangeException: Index was outside the bounds of the array.
(wrapper stelemref) System.Object.virt_stelemref_class(intptr,object)
UnityEngine.UI.Selectable.OnDisable () (at C:/Program Files/Unity/Hub/Editor/2019.4.3f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Selectable.cs:526)
UnityEngine.GameObject:SetActive(Boolean)
ActorMenu:SetBackPackInitialPositions() (at Assets/Game/SCRIPT/ActorMenu.cs:1182)
ActorMenu:OnEnable() (at Assets/Game/SCRIPT/ActorMenu.cs:787)as well as
IndexOutOfRangeException: Index was outside the bounds of the array.
UnityEngine.UI.Selectable.OnDisable () (at C:/Program Files/Unity/Hub/Editor/2019.4.3f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Selectable.cs:523)
UnityEngine.GameObject:SetActive(Boolean)
ActorMenu:SetBackPackInitialPositions() (at Assets/Game/SCRIPT/ActorMenu.cs:1182)
ActorMenu:OnEnable() (at Assets/Game/SCRIPT/ActorMenu.cs:787)Happens when updating a script while the game is running.
Is resolved by restarting unity, but occurs again within 15-20 minutes.
Cannot be resolved without restarting the editor.Can be avoided by not updating a script until the game is not running. However many people use live script updating, so this would ruin said feature.
-
Gaia_vp
Jan 22, 2021 15:32
Hi DPOTUZNIK
would you mind pitting some steps to reproduce, we will appreciate it a lot
Thanks so much..!!! -
dpotuznik
Jan 20, 2021 12:21
me too 2020.2.1f1
-
Synamon
Sep 22, 2020 15:59
2019.4.1.f1
me too
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- The first frames are skipped when playing a video
- Text auto-scrolling can not work when naming assets/objects until backspace key is pressed
- Shadows are not cast when the Light's CullingMask and the GameObject's Layer do not match
- Graphics.DrawMeshInstanced does not work when 2D Renderer and 2D Shaders are used
- SpeedTree does not move when using WindZone
Resolution Note:
Cannot Reproduce, but if the users reporting this issue can provide steps to reproduce, we'll re-open it.