Quick answer: Unity VFX Graph CPU event from C# not triggering graph reactions? The send call must use a matching VFXEventAttribute; type mismatches fail silently.

C# calls vfx.SendEvent("OnHit") and passes a Vector4; the graph expects a Color and ignores the event.

Match Attribute Types

var attr = vfx.CreateVFXEventAttribute();
attr.SetVector3("hitPosition", pos);
vfx.SendEvent("OnHit", attr);

Build attribute with matching types/names. Graph reads these as per-event variables.

Event Names in Graph

The graph’s Event context has a name (default OnPlay / OnStop, custom for user events). Name must match exactly; case-sensitive.

Pre-Cache PropertyID

Use Shader.PropertyToID("OnHit") once; pass the int to SendEvent. Avoids per-call string hashing.

Spawn Context Required

The Event must connect to a Spawn context (Single Burst etc.). Floating event with no Spawn destination consumes input silently.

Verifying

Events from C# produce expected graph reactions. Attributes populate spawn rates / positions correctly.

“CPU events need matching names, types, and a Spawn destination.”

Document the event interface in a comment at the top of the VFX asset — saves callers from guessing parameter names.