Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Retrieving contacts count only from a specific collision
#2
You can count how many contacts reference a specific collider yourself. Simply check the collider referenced by each contact and if it's the one you're interested in, increase a counter. This is what is done in the FluidMaze sample scene to determine if the fluid is in contact with specific dye blocks.

See "Retrieving the collider involved in a contact" in the manual's scripting section:

http://obi.virtualmethodstudio.com/manua...sions.html

You can also take a look at the sample script you'll find at the very end of that page. It checks if fluid is in contact with a specific trigger collider (by comparing its tag), and if so, accelerate particles in a direction opposite to gravity (effectively creating a zero-G zone).
Reply


Messages In This Thread
RE: Retrieving contacts count only from a specific collision - by josemendez - 14-07-2021, 09:39 AM