GPU Event not working. Leads to Null Reference Exception

Hello. New to VFX. Initial system works. Secondary system does not.
Working on spawning child particles using trigger on die > GPU event, etc.

However, Whenever I connect the 2nd quad output, it stops the entire particle system from working and prints an error in the console.

This is a single console error, printed repeatedly whenever I make any changes to the particle system while the second quad output is linked up.
Exception while compiling expression graph: System.NullReferenceException: Object reference not set to an instance of an object
at UnityEditor.VFX.VFXData.ProcessDependencies () [0x00021] in D:\PROJECTS\GAME Projects_UNITY ENGINE PROJECTS\PROJECTS\VFX 2019\Library\PackageCache\com.unity.visualeffectgraph@6.7.1-preview\Editor\Data\VFXData.cs:365
at UnityEditor.VFX.VFXGraphCompiledData.Compile (UnityEditor.VFX.VFXCompilationMode compilationMode, System.Boolean forceShaderValidation) [0x00239] in D:\PROJECTS\GAME Projects_UNITY ENGINE PROJECTS\PROJECTS\VFX 2019\Library\PackageCache\com.unity.visualeffectgraph@6.7.1-preview\Editor\Compiler\VFXGraphCompiledData.cs:643 : at UnityEditor.VFX.VFXData.ProcessDependencies () [0x00021] in D:\PROJECTS\GAME Projects_UNITY ENGINE PROJECTS\PROJECTS\VFX 2019\Library\PackageCache\com.unity.visualeffectgraph@6.7.1-preview\Editor\Data\VFXData.cs:365
at UnityEditor.VFX.VFXGraphCompiledData.Compile (UnityEditor.VFX.VFXCompilationMode compilationMode, System.Boolean forceShaderValidation) [0x00239] in D:\PROJECTS\GAME Projects_UNITY ENGINE PROJECTS\PROJECTS\VFX 2019\Library\PackageCache\com.unity.visualeffectgraph@6.7.1-preview\Editor\Compiler\VFXGraphCompiledData.cs:643
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

This is the generic setup

What I am trying to figure out is the cause of the error and a fix for it so I can use these GPU events effectively.

Side-note: Surprisingly, there isn’t much on the forums about gpu events or this particular issue. The closest thing is this link, but it doesn’t cover or touch my issue.

I had the same issue - I then connected the GPU Event directly to the Initialize block, which helped.

1 Like

Wow, beautiful advice. Thank you =)

1 Like

Glad it helped! :slight_smile: (I noticed that the GPUEvent emits a SpawnEvent, which the initialize block also does, so I assumed I do not need it)

Hmm… I am trying to use a “Spawn over Distance” via a GPU Event, which I believe requires being called from the Spawn block. Am I just out of luck for that then?

I’m having this same problem. No matter how I try to connect a GPUEvent to a particle system, I get exceptions when it tries to compile.

HOWEVER, if I change the second particle system to use particle strips, it works fine. But I don’t want strips! Is there a bug report for this yet?

gpu event gets directly connected to initialize block

Yep… I’ve connected it directly to the initialize block for both particle and particle strip, only particle strip compiles without exceptions. literally nothing else different.

I do not promise to be an expert, lol. But maybe posting a picture of your set up will provide more insight?

Why I can’t find any GPU Event, and no triggers at all ?.. I’m using 2019.4.12f1 lts and Visual Effect Graph 7.3.1


Can’t recall if it was an experimental block in 7.3.1 but you could try in Unity > Preferences > Visual Effects > [Experimental Operators/Blocks] and then see if you can find it. Since you didn’t specify if you’re new to it or not i’ll give fairly obvious advice that not all blocks be put into all contexts.