Alchemist0823 / three.quarks

Three.quarks is a general purpose particle system / VFX engine for three.js
https://quarks.art
480 stars 22 forks source link

how to start particle more than 1 time without looping #78

Closed Trusiak closed 4 months ago

Trusiak commented 5 months ago

I would like to create an effect such as we currently have on the three.quark website - i.e. pressing a button triggers an effect, the next press triggers another, etc.

image

Currently, using addSystem will simply add an effect to me that executes once (if it is not looped)

this.quarksRenderer.addSystem(child.system);

but calling the function again and creating a new object will not trigger the effect a second time - only loading it and downloading the asset again will allow this.

So, how do you trigger effect after effect depending on the will of the user? (effect read from json file)

Alchemist0823 commented 5 months ago

You could use the restart function on that system or traverse the object and call restart on every particle system in the object tree.

Trusiak commented 5 months ago

@Alchemist0823 i tried, but for some reason when system finished his work, it clears the children array - so i can't iterate throught and restart.

image

this is how particle system instance look after done

Alchemist0823 commented 5 months ago

Can you attach your JSON file? also, could you search autoDestroy in the JSON file and set it to false?

Trusiak commented 4 months ago

ok, that helped. Thanks!