0
Fixed

2.0.0a7 InvalidOperationException: Collection was modified; enumeration operation may not execute.

Ex-Crow 1 year ago updated by Lazlo Bonin (Lead Developer) 1 year ago 2

A custom event invoked in a behaviour graph that targets a state machine transition throws this error.

Behaviour graph's event trigger: https://imgur.com/3rJD7Sn

State Machine's transition: https://imgur.com/JhrkPAf

The logic executes and transitions the state machine, but I also get this error:

InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.HashSet`1+Enumerator[T].MoveNext () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
Ludiq.Bolt.ClassHost.InvokeEvent (Ludiq.Bolt.ClassEvent event, System.Object[] args) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassHost.cs:719)
Ludiq.Bolt.InvokeClassEvent.Invoke (Ludiq.Bolt.Flow flow) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Architecture/InvokeClassEvent.cs:110)
Ludiq.Bolt.Flow.InvokeDelegate (Ludiq.Bolt.ControlInput input) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:513)
Rethrow as GraphPingException:
Ludiq.Bolt.Flow.InvokeDelegate (Ludiq.Bolt.ControlInput input) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:517)
Ludiq.Bolt.Flow.Invoke (Ludiq.Bolt.ControlOutput output) (at Assets/Ludiq/Bolt.Flow/Runtime/Flow.cs:408)
Ludiq.Bolt.EventHandlerUnit`1[TArgs].Invoke (Ludiq.Bolt.GraphReference reference, TArgs args) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Events/EventHandlerUnit.cs:114)
Ludiq.Bolt.EventHandlerUnit`1+<>c__DisplayClass17_0[TArgs].b__0 (TArgs args) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Events/EventHandlerUnit.cs:73)
Ludiq.Bolt.EventBus.Invoke[TArgs] (Ludiq.Bolt.EventHook hook, TArgs args) (at Assets/Ludiq/Bolt.Core/Runtime/Events/EventBus.cs:153)
UnityEngine.Debug:LogException(Exception, Object)
Ludiq.Bolt.EventBus:Invoke(EventHook, EmptyEventArgs) (at Assets/Ludiq/Bolt.Core/Runtime/Events/EventBus.cs:157)
Ludiq.Bolt.ClassHost:InvokeEvent(EventHookID) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassHost.cs:813)
Ludiq.Bolt.UnityClassHost:Start() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/UnityClassHost.cs:29)
Ludiq.Bolt.ClassComponent:Start() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/ClassComponent.cs:85)

Bolt Version:
2.0.0a7
Unity Version:
2019.2.18
Platform(s):
PC
Scripting Backend:
Mono
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2
Fixed (Unreleased)

Hi TowerCrow,

Thanks for the report. This will be fixed in the next version.