How do i reset size of a Shape with in VFX graph?

i have a VFX graph that has an emitter shape that gets bigger as the VFX progresses, however, whenever i trigger the event, the size doesn’t reset. it remains the same. How can i reset the size of that emitter shape every time it is triggered.

Im using a Set Position (Shape: Torus Arc) and using a curve to increase the size of X and Y scale, however, triggering the event again, does not reset upon triggering the event again.

I asked chatGPT, but it told me to add nodes and blocks that don’t even exists and nobody from my friend group was able to help with this.

Hi!

Can you post a picture of your graph?

Sounds like something that you could fix using a exposed property and setting the initial Time when you trigger the event.


Here is the graph. I tried adding a float, but I’m not exactly sure how to change it from the timeline either.

Since you want to modify the spawn volume (set at Initialize) over the duration of the emitter, you need to expose a variable that decides the “Loop Duration” (this will let you calculate a normalized value representing the % duration) and a “Set Spawn Time” node in your “Spawn” block.

The “Set Spawn Time” will set the “Spawn Time” Attribute, that you can then retrieve in the “InitializeParticle” block (if not, this attribute will not be set and probably always return 0).

Using your “Loop Duration” variable, you can divide SpawnTime / LoopDuration and get a normalized value (0…1) representing the duration of the emitter.
You can then use this value to feed a Curve.

2 Likes

If you want to restart the animation for each event, you can add an exposed property and use it as an offset:

Every time you trigger an event, you have to set “Start Time” variable to the time passed since the VFX was started.

Alternatively, you can control the size directly from the timeline, if that is what you are using to control the VFX:
https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@7.1/manual/Timeline.html

2 Likes

Sadly, i don’t seem to have a LoopDuration node option in the Spawn System, but thanks for the help. I’ll try to do this through the timeline.

Check your inspector when selecting nodes! Most of them have options that can be toggled

1 Like

Ah, thank you so much.

1 Like