Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  KillParticle after collision and shouldn't return
#1
Good Morning,

I am having an issue that I am hoping to get some help on.

- I have a collider that will destroy individual particles when collision takes place. I need to Disable, Kill, change Life of the singular particle so that it doesn't go back into the pool and get re-emitted.


Scenario: Barrel tips over, at certain angle emitter speed goes up, emission begins. The particles that have been emitted and then collided with get "cleaned" up and in this process, destroyed and prevented from going back into the emitter pool.

Just having trouble with the code line for disabling the particles from the pool that have been collided with. 

Thanks!

What i have thus far:

if(collider.tag == "ParticleKiller")
                    {
                        
                        
                        // do something with the collider.
                        int killThisParticle = solver.particleToActor[contact.particle].indexInActor;
                        emitter.KillParticle(killThisParticle);
                       
                        // get particle indices and 
                        
                            //disable from active emitter


                    }
Reply


Messages In This Thread
KillParticle after collision and shouldn't return - by adamgffrd - 26-09-2020, 02:20 PM