Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  tearing cloth access
#5
(21-03-2022, 01:31 PM)josemendez Wrote: Hi!

This is a regular C# event, that you can subscribe to like this:

Code:
cloth.OnClothTorn += CallMeWhenClothIsTorn;

You must make sure the "CallMeWhenClothIsTorn" method (sample name, you can call it as you wish) has the following signature:

Code:
void CallMeWhenClothIsTorn(ObiTearableCloth cloth, ObiClothTornEventArgs tearInfo)

That's it. You can then use tearInfo.particleIndex inside that method to retrieve data about that particle.

If you're unfamiliar with C# programming, you might want to take a look at the basics first. Events/delegates are an intermediate-level language feature, Obi assumes that you know what they are and how to use them.
Thank you very much, now it's clear!
Reply


Messages In This Thread
tearing cloth access - by maygdirf - 21-03-2022, 09:15 AM
RE: tearing cloth access - by josemendez - 21-03-2022, 11:57 AM
RE: tearing cloth access - by maygdirf - 21-03-2022, 01:24 PM
RE: tearing cloth access - by josemendez - 21-03-2022, 01:31 PM
RE: tearing cloth access - by maygdirf - 23-03-2022, 09:07 AM