I start spawning particle by custom Event that is connected with Spawn Start “Single burst”.
I’m trying to send some data for “Spawn” and “Initialize Particle” context. (particle count per burst etc.)
Since GetCustomAttribute (Operator Attribute) is kind of not working I was thinking about using Exposed Property.
Setting property and than raising event, setting property again and again raise event.
Problem is that I don’t know if spawning/initializing is going to be deffered and my first event will use second values instead of the first one.
I’m actually not very sure about the differences between Exposed Properties and Event Attributes.
As you have pointed out, using Event Attributes can guarantee that the attribute update is synced with SendEvent. In addition to that, is there anything else that makes Event Attributes better than Exposed Properties?
GetCustomAttribute should work, at least in the more recent versions. Alternatively, you can also just send data to some other existing attribute, like this:
attrib = vfx.CreateVFXEventAttribute();
attrib.SetVector3("targetPosition", new Vector3(1,2,3));
vfx.SendEvent("Boom", attrib);
And then grab it’s source value in Initialize:
It’s not about better, but different. You can for example use an exposed property to change the color of already existing particles, but you can’t do so via an event (as the color will only be applied to the new particles). In addition, you use event attributes not only to send over values, but to also trigger the spawn itself.