Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Collide once
#1
So I have a box collider and it's set to isTrigger= true, and eveytime the rope passes through to it, it will increase your score. It works but sometimes it's getting called twice. I just want it to work like OnTriggerEnter.
Reply
#2
(21-09-2020, 07:00 AM)joshuajames1 Wrote: So I have a box collider and it's set to isTrigger= true, and eveytime the rope passes through to it, it will increase your score. It works but sometimes it's getting called twice. I just want it to work like OnTriggerEnter.

Obi provides access to the full contact list every frame. Any further contact processing/filtering is your responsibility.

So, if a particle is inside a collider for say, 10 frames, a contact between a rope particle and the collider will appear in the list for 10 frames. Getting a behavior similar to OnTriggerEnter is trivial though: use a bool value to detect a frame during which a contact between the rope and the collider is present, that wasn't present the previous frame.
Reply