The event node I found only tied to a spawn node and I don’t know what to do with it (I have very little experiences of coding).
I only found tutorial to trigger event to spawn more particles
There is no way to do this with events, but it’s possible to create event like behaviour with property.
Create boolean property in blackboard, implement your logic and run it when property is true. For example when it’s true then set color to red, otherwise set to current color (nothing changes). If you are on unity 2022 this should be even easier as boolean port where implemented in blocks.
Remember to reset property value to false in the next frame, so it does work once.
It there a way to get VFX time within VFX Graph right when the bool is activate and store it as a float to use later?
I was thinking about this node but havent found a way to use it.
Right now I am not aware of any way to store or update blackboard property from inside the graph, however you can store it in one of particle attributes. If you need only one value per all particles then it’s a lot of duplicated data, but it should definitely work and if it’s just one float it should be fine. Whatever makes your job done
You can try this method, or use directly the output of the branch.
If your bool is set to false, you will get 0, if it’s true you will the TotalTime value
The bool can be replaced by the boolean property you have in your blackboard.
You can do that by using a compare node. In that example, the bool will be set to true when TotalTime is superior to one.
You can change the condition of the compare node to fit your needs
Using the same principle, you can use this data with a Boolean to affect other options: (or directly enable/disable blocks if you are on 22.2 or higher) In this example I used the TargetPosition to store the data as it’s not used anywhere in the graph so it won’t cause any issues.
Limitations:
Inherit only works in initialize, you cannot use it to affect already existing particles
Custom attributes are not implemented in SpawnEvent