20-05-2021, 08:53 PM
(This post was last modified: 20-05-2021, 08:55 PM by josemendez.)
DryGinStudios Wrote: The enter even seems only to be on the first particles in a collider. The Stay even does seem to work but once again I don't have when one particle leave as the LEAVE event is only triggered when all particles leave the collider (or it seems to be.)
Well, that’s how enter/exit events work: you get an enter event when the first particle in the actor enters, and an exit event when the last one exits. What you seem to need is just a count of how many particles are in the collider at any given time. No need to use events for that.
Quote:I can get how many enter and it works correctly with the maze example but I can't figure out when it leaves the BoxCollider2d. You said to use the raw data of contact but I can't find where this is. I could in an Update function check each contact from the raw list to check if the contact is with the collider but I can't find that list.
See: http://obi.virtualmethodstudio.com/tutor...sions.html
You subscribe to solver.OnCollision, and it will give you the raw contact list every frame. You then just count how many of them are against whichever collider/trigger you’re interested in.