Hi all. So i’ve been having this thing a few times, but not sure what steps i did exactly.
I was making subgraphs, adding input and output, and then used it in 1 of my existing graph. Due to the error this time, i couldn’t take screenshot of the graph. Only the subgraph (if that’s even related, i’m not sure)
Error in short:
rgumentException: Invalid CastFloat : UnityEditor.VFX.VFXValue`1[System.Single] to Int32
UnityEditor.VFX.VFXOperatorUtility.CastFloat (UnityEditor.VFX.VFXExpression from, UnityEngine.VFX.VFXValueType toValueType, System.Single defaultValue) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperatorUtility.cs:479)
So as for the offending graph itself, i think i connected the “Modulo” output (which is int), to a… Subtract against ParticleId, then Saturate, then Spawn Over Time block.
I don’t even know if that’s correct or optimize whatsoever, but i was still working on it.
The point is, how am i supposed to debug if i can’t even open the graph?
Cheers
Complete error
ArgumentException: Invalid CastFloat : UnityEditor.VFX.VFXValue1[System.Single] to Int32 UnityEditor.VFX.VFXOperatorUtility.CastFloat (UnityEditor.VFX.VFXExpression from, UnityEngine.VFX.VFXValueType toValueType, System.Single defaultValue) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperatorUtility.cs:479) UnityEditor.VFX.VFXOperatorUtility.Clamp (UnityEditor.VFX.VFXExpression input, UnityEditor.VFX.VFXExpression min, UnityEditor.VFX.VFXExpression max, System.Boolean autoCast) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperatorUtility.cs:82) UnityEditor.VFX.VFXOperatorUtility.Clamp (UnityEditor.VFX.VFXExpression input, UnityEditor.VFX.VFXExpression min, UnityEditor.VFX.VFXExpression max) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperatorUtility.cs:74) UnityEditor.VFX.VFXPropertyAttribute.ApplyToExpressionGraph (UnityEditor.VFX.VFXPropertyAttribute[ ] attributes, UnityEditor.VFX.VFXExpression exp) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Types/VFXPropertyAttribute.cs:62) UnityEditor.VFX.VFXSlot.SetOutExpression (UnityEditor.VFX.VFXExpression exp, System.Collections.Generic.HashSet
1[T] toInvalidate, UnityEditor.VFX.VFXCoordinateSpace convertToSpace) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:1013)
UnityEditor.VFX.VFXSlot.RecomputeExpressionTree () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:973)
UnityEditor.VFX.VFXSlot.GetExpression () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:232)
UnityEditor.VFX.VFXOperator+<>c.b__6_1 (UnityEditor.VFX.VFXSlot s) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperator.cs:118)
UnityEditor.VFX.VFXOperator.GetSlotPredicateRecursive (System.Collections.Generic.List1[T] result, System.Collections.Generic.IEnumerable
1[T] slots, System.Func2[T,TResult] fnTest) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperator.cs:20) UnityEditor.VFX.VFXOperator.UpdateOutputExpressions () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperator.cs:118) UnityEditor.VFX.VFXSlot.RecomputeExpressionTree () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:932) UnityEditor.VFX.VFXSlot.GetExpression () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:232) UnityEditor.VFX.VFXSlot.UpdateLinkedInExpression (UnityEditor.VFX.VFXSlot destSlot, UnityEditor.VFX.VFXSlot refSlot) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:872) UnityEditor.VFX.VFXSlot.RecomputeExpressionTree () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:925) UnityEditor.VFX.VFXSlot.GetExpression () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Slots/VFXSlot.cs:232) UnityEditor.VFX.VFXOperator+<>c.<UpdateOutputExpressions>b__6_1 (UnityEditor.VFX.VFXSlot s) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperator.cs:118) UnityEditor.VFX.VFXOperator.GetSlotPredicateRecursive (System.Collections.Generic.List
1[T] result, System.Collections.Generic.IEnumerable1[T] slots, System.Func
2[T,TResult] fnTest) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperator.cs:20)
UnityEditor.VFX.VFXOperator.UpdateOutputExpressions () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/Models/Operators/VFXOperator.cs:118)
UnityEditor.VFX.UI.VFXOperatorController…ctor (UnityEditor.VFX.VFXOperator model, UnityEditor.VFX.UI.VFXViewController viewController) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/Elements/Controllers/VFXOperatorController.cs:35)
UnityEditor.VFX.UI.VFXViewController.AddControllersFromModel (UnityEditor.VFX.VFXModel model) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/Views/Controller/VFXViewController.cs:1721)
UnityEditor.VFX.UI.VFXViewController.SyncControllerFromModel (System.Boolean& groupNodeChanged) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/Views/Controller/VFXViewController.cs:1503)
UnityEditor.VFX.UI.VFXViewController.GraphChanged () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/Views/Controller/VFXViewController.cs:968)
UnityEditor.VFX.UI.VFXViewController.ModelChanged (UnityEngine.Object obj) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/Views/Controller/VFXViewController.cs:840)
UnityEditor.VFX.UI.VFXViewController…ctor (UnityEditor.VFX.VisualEffectResource vfx) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/Views/Controller/VFXViewController.cs:1326)
UnityEditor.VFX.UI.VFXViewController.GetController (UnityEditor.VFX.VisualEffectResource resource, System.Boolean forceUpdate) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/Views/Controller/VFXViewController.cs:1301)
UnityEditor.VFX.UI.VFXViewWindow.InternalLoadResource (UnityEditor.VFX.VisualEffectResource resource) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/VFXViewWindow.cs:101)
UnityEditor.VFX.UI.VFXViewWindow.LoadResource (UnityEditor.VFX.VisualEffectResource resource, UnityEngine.VFX.VisualEffect effectToAttach) (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/VFXViewWindow.cs:76)
UnityEditor.VFX.UI.VFXViewWindow.b__18_0 () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/VFXViewWindow.cs:169)
UnityEditor.VFX.UI.VFXViewWindow.Update () (at Library/PackageCache/com.unity.visualeffectgraph@7.1.8/Editor/GraphView/VFXViewWindow.cs:242)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <6f28216fea9f453abf2e05b770ed3ee4>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <6f28216fea9f453abf2e05b770ed3ee4>:0)
UnityEditor.HostView.SendUpdate () (at <6f28216fea9f453abf2e05b770ed3ee4>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvokeImpl (System.Object[ ] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.MulticastDelegate.DynamicInvokeImpl (System.Object[ ] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Delegate.DynamicInvoke (System.Object[ ] args) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <6f28216fea9f453abf2e05b770ed3ee4>:0)