IndexOutOfRangeException: Array index is out of range.
« on: July 02, 2015, 11:59:51 AM »
Getting an exception and thought I'd register and post it.
Unity Version 4.6.3 can't find the DoTween version :/

Code: [Select]
I/Unity   (19068): IndexOutOfRangeException: Array index is out of range.
I/Unity   (19068):   at (wrapper stelemref) object:stelemref (object,intptr,object)
I/Unity   (19068):   at DG.Tweening.Core.TweenManager.AddActiveTween (DG.Tweening.Tween t) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.Core.TweenManager.GetTweener[Single,Single,FloatOptions] () [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.DOTween.ApplyTo[Single,Single,FloatOptions] (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Single endValue, Single duration, DG.Tweening.Plugins.Core.ABSTweenPlugin`3 plugin) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.DOTween.To (DG.Tweening.Core.DOGetter`1 getter, DG.Tweening.Core.DOSetter`1 setter, Single endValue, Single duration) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at DG.Tweening.DOTween.To (DG.Tweening.Core.DOSetter`1 setter, Single startValue, Single endValue, Single duration) [0x00000] in <filename unknown>:0
I/Unity   (19068):   at Loadingbar.SetProgress (Single levelLoadProgress, System.String text, System.String headlineText, Boole

Code calling it looks like this
Code: [Select]
        if(tweener != null && tweener.IsActive()) {
            tweener.ChangeEndValue(progress, true);
        }
        else {
            DOSetter<float> doSetter = value => {
                float f = Mathf.Min(value - slider.value, 0.01f);
                //Debug.Log(Time.frameCount + " " + Time.realtimeSinceStartup + " doSetter " + value + " : " + (slider.value + f) + " " + f);
                if(slider.value + f <= value) {
                    slider.value += f;
                    //slider.value = value;
                }
            };
            tweener = DOTween.To(doSetter, slider.value, progress, 0.25f);
            tweener.SetSpeedBased(true);
            tweener.SetUpdate(true);
            tweener.SetEase(Ease.Linear);
        }

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: IndexOutOfRangeException: Array index is out of range.
« Reply #1 on: July 02, 2015, 03:17:10 PM »
Are you calling DOTween.Clear (or ClearAll) at any point before the error happens?


Can you check the DOTween version by going to Tools > DOTween Utility Panel, and see what's written there?