playMaker

Author Topic: Particles play once  (Read 1284 times)

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Particles play once
« on: September 13, 2015, 04:11:22 PM »
im using PlayMaker Unity UI Proxy, 

how can I do to play the particles one time, at the touch of button, and then only return to play if i tap another button, destroy them, and then come back to play at the touch of another button.

Because the particles are creating copies when I touch the same button.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15373
  • Official Playmaker Support
    • View Profile
Re: Particles play once
« Reply #1 on: September 14, 2015, 12:22:53 AM »
Hi,

 it's not the particles that creates copy, it's your logic, so in your logic you need to maintain a flag or check if you have already created an instance of your prefab and simply reuse it if already created, else create it.


 Bye,

 Jean

nabilfx

  • Full Member
  • ***
  • Posts: 186
    • View Profile
Re: Particles play once
« Reply #2 on: September 14, 2015, 06:24:17 AM »
its creating clones copy, i need to play once.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15373
  • Official Playmaker Support
    • View Profile
Re: Particles play once
« Reply #3 on: September 14, 2015, 10:28:23 PM »
Hi,

 then, don't create copies, and add that prefab during editing, and for example have an Fsm on it that you send an event to, like "FIRE PARTICLES" or something, and that fsm will play the particle system.

The "play once" feature of a particle system is to be setup on the particle component itself, by uncheking "Looping".

Bye,

 Jean