05-09-2022, 01:51 PM
(This post was last modified: 05-09-2022, 01:53 PM by josemendez.)
(05-09-2022, 01:49 PM)0hsyn1 Wrote: I was doing silly experiments I added the wrong code I added the wrong code. Sorry
counter runs but returns a number greater than 400 particles
Yes, as I explained this will add one to the counter every frame a particle is in contact with the collider. So unless particles are only in contact for one frame (which is highly unlikely), it will return a number far greater than 400.
What you want is to determine if a particle has already been counted and if so, ignore it. There's many ways to do this, easiest is to use a hash set. See:
http://obi.virtualmethodstudio.com/forum...=collision