Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndexOutOfRangeException In InterpolateFast
#5
Nice, ok. I have a similare little issue with that script:
[Image: IHCh2VC4lBG_pool.PNG]

When I am editing a prefabs, who contain a generator (a generator who doesn't have a spline reference by itself),
I get this error in the console when I am editing the prefabs:

InvalidOperationException: Destroying a GameObject inside a Prefab instance is not allowed.

It's not a big deal, I have solve that problem by adding that:

Code:
if (!Application.isPlaying)
           {
               if (!ComponentPool.IsInPrefabStage())
               {
                   DestroyImmediate(item.gameObject);
               }
           }

And the static function:
Code:
private static bool IsInPrefabStage()
       {
#if UNITY_2018_3_OR_NEWER
           var stage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
           return (stage != null);
#else
   return false;
#endif
       }
Reply


Messages In This Thread
RE: IndexOutOfRangeException In InterpolateFast - by UsernameHed - 08-28-2019, 08:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IndexOutOfRangeException in CurvySplineSegment.LocalFToDistance billowe 2 753 09-06-2022, 06:09 AM
Last Post: sambutle
Question IndexOutOfRangeException in CurvySplineSegment.LocalFToDistance function mchangxe 13 3,243 05-06-2021, 12:56 PM
Last Post: _Aka_

Forum Jump: