at the end of destroyAsteroid(), the very last line StartCoroutine()
my guess is the coroutine is already being destroyed elsewhere?
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <4a4789deb75f446a81a24a1a00bdd3f9>:0)
AudioReference.GetRandomClip (System.Boolean setNewIndex) (at Assets/Scripts/Sounds/AudioReference.cs:39)
Asteroid+d__16.MoveNext () (at Assets/Scripts/Entities/Asteroids/Asteroid.cs:83)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
Asteroid:DestroyAsteroid() (at Assets/Scripts/Entities/Asteroids/Asteroid.cs:126)
Asteroid:Damage(Int32) (at Assets/Scripts/Entities/Asteroids/Asteroid.cs:55)
Projectile:OnTriggerEnter2D(Collider2D) (at Assets/Scripts/Entities/Projectile.cs:69)
at the end of destroyAsteroid(), the very last line
StartCoroutine()
my guess is the coroutine is already being destroyed elsewhere?
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <4a4789deb75f446a81a24a1a00bdd3f9>:0) AudioReference.GetRandomClip (System.Boolean setNewIndex) (at Assets/Scripts/Sounds/AudioReference.cs:39) Asteroid+d__16.MoveNext () (at Assets/Scripts/Entities/Asteroids/Asteroid.cs:83)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
Asteroid:DestroyAsteroid() (at Assets/Scripts/Entities/Asteroids/Asteroid.cs:126)
Asteroid:Damage(Int32) (at Assets/Scripts/Entities/Asteroids/Asteroid.cs:55)
Projectile:OnTriggerEnter2D(Collider2D) (at Assets/Scripts/Entities/Projectile.cs:69)