Hey,
I have a VFX graph and I would like to change the color of the particles instantly but only once during a playthrough.
To better understand: the VFX represents a checkpoint, it starts white and turns red when the player reaches it. So this change will occur only once in a lifetime of the game. The color is an exposed property of the VFX graph and is changed by a script.
I made 3 attempts:
- Set color on initialization, but then it does not turn red instantly when the player reaches it (it needs to wait for particles to die and then the new particles will be red)
- Set color on update, works like a charm but Im concern about having many VFX graphs constantly updating their colors in the scene while this change actually occurs just once.
- Set color on update but deactivate the module with an exposed boolean (only activate it for a few frames when the change occurs using a coroutine), works like a charm but is it worth it? Am I over-optimizing? Is there something better to do?
Thanks for your feedback!