0
Not a Bug

Specified cast is not valid.

Balaji 11 months ago updated by Lazlo Bonin (Lead Developer) 11 months ago 2

(Context: Tried to set a bool from another object going through a list with a for each loop.)

InvalidCastException: Specified cast is not valid.
(wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
Ludiq.Bolt.BoltMemberUnit`3[TType,TMember,TTarget].FetchTarget (Ludiq.Bolt.Flow flow) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Architecture/BoltMemberUnit.cs:71)
Ludiq.Bolt.BoltClassMemberUnit`1[TMember].FetchTarget (Ludiq.Bolt.Flow flow) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Architecture/BoltClassMemberUnit.cs:42)
Ludiq.Bolt.SetBoltClassVariable.Set (Ludiq.Bolt.Flow flow) (at Assets/Ludiq/Bolt.Flow/Runtime/Units/Architecture/SetBoltClassVariable.cs:69)
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.BoltClassShellTrait:InvokeEvent(EventHookID) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/BoltClassShellTrait.cs:870)
Ludiq.Bolt.BoltUnityClassShellTrait:Update() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/BoltUnityClassShellTrait.cs:35)
Ludiq.Bolt.BoltComponent:Update() (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/BoltComponent.cs:126)

Bolt Version:
2.0.0a10
Unity Version:
2019.2.8f1
Platform(s):
OSX
Scripting Backend:
.NET Version (API Compatibility Level):
Bolt 2

Update: Got resolved by using the scene variable instead of graph variable for setting the for-each loop item. Not a bug.

Not a Bug

Hi Balaji,

I'll trust your conclusion and mark this as NAB. If ever you see a similar issue reappear, please make sure to include the graph that causes it so we can reproduce it on our end.

Thanks!