Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mobile performance
#19
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.
Reply


Messages In This Thread
Mobile performance - by DryGinStudios - 12-05-2021, 04:05 PM
RE: Mobile performance - by josemendez - 12-05-2021, 04:55 PM
RE: Mobile performance - by DryGinStudios - 12-05-2021, 05:18 PM
RE: Mobile performance - by DryGinStudios - 12-05-2021, 08:04 PM
RE: Mobile performance - by josemendez - 13-05-2021, 07:43 AM
RE: Mobile performance - by DryGinStudios - 13-05-2021, 12:32 PM
RE: Mobile performance - by DryGinStudios - 12-05-2021, 09:10 PM
RE: Mobile performance - by DryGinStudios - 17-05-2021, 10:02 PM
RE: Mobile performance - by josemendez - 18-05-2021, 07:45 AM
RE: Mobile performance - by DryGinStudios - 18-05-2021, 02:52 PM
RE: Mobile performance - by josemendez - 18-05-2021, 02:54 PM
RE: Mobile performance - by DryGinStudios - 18-05-2021, 10:44 PM
RE: Mobile performance - by josemendez - 19-05-2021, 07:44 AM
RE: Mobile performance - by DryGinStudios - 19-05-2021, 04:49 PM
RE: Mobile performance - by josemendez - 20-05-2021, 07:43 AM
RE: Mobile performance - by DryGinStudios - 20-05-2021, 12:56 PM
RE: Mobile performance - by josemendez - 20-05-2021, 01:45 PM
RE: Mobile performance - by DryGinStudios - 20-05-2021, 03:56 PM
RE: Mobile performance - by josemendez - 20-05-2021, 08:53 PM