Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect when cloth removed from trigger
#3
(19-08-2019, 01:56 PM)josemendez Wrote: Hi there,

Collision callbacks are the only way to get feedback on particle-collider inside/outside status.

Keep track of a simple boolean value. Set it to true when any particle in the cloth is inside the trigger, set it to false when no particle is inside the trigger. When setting it to false, check if it was true before, in that case you know the cloth was inside the trigger but went out during the current frame.

To detect tear events, simply subscribe to the cloth's OnConstraintTorn event.

Thanks for getting back to me! Really great asset by the way.

Interesting. I was having a lot of lag because of what i'm trying to accomplish. Lots of collisions happening with a sticky material. Any suggestions on streamlining that or only getting collisions getting called at the vertices?

Ah... Easy enough about the tears. Thank you. Sonrisa
Reply


Messages In This Thread
RE: Detect when cloth removed from trigger - by neecko - 19-08-2019, 04:08 PM