Help cloth-rope collision - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html) +--- Thread: Help cloth-rope collision (/thread-3414.html) |
cloth-rope collision - maygdirf - 21-04-2022 Hi! It's possible to detect cloth-rope collisions? I have a cloth that simulates a piece of tissue and i would be able to create a needle with a thread that penetrates the cloth. In so doing, I'm not able to detect the particle collisions between the two. Am I doing something wrong? RE: cloth-rope collision - josemendez - 21-04-2022 (21-04-2022, 10:31 AM)maygdirf Wrote: Hi! Hi there, Collisions between actors (rope and cloth, for instance) should happen automatically by default, unless you have changed the collision filters in either actor to specify otherwise. You talk about "detecting the particle collisions", so I take it you're using a script to detect the contacts at runtime? can you share the script you're using? RE: cloth-rope collision - maygdirf - 21-04-2022 (21-04-2022, 10:37 AM)josemendez Wrote: Hi there, Code: private void Awake() RE: cloth-rope collision - josemendez - 21-04-2022 You're subscribed to solver.OnCollision, instead of solver.OnParticleCollision. So your code is looking at the collisions between particles and colliders, not particle-particle collisions. cheers! RE: cloth-rope collision - maygdirf - 21-04-2022 (21-04-2022, 11:21 AM)josemendez Wrote: You're subscribed to solver.OnCollision, instead of solver.OnParticleCollision. So your code is looking at the collisions between particles and colliders, not particle-particle collisions.Nice! I'm stupid But the subscription to the Solver_OnCollision function remains the same? RE: cloth-rope collision - josemendez - 21-04-2022 (21-04-2022, 01:47 PM)maygdirf Wrote: But the subscription to the Solver_OnCollision function remains the same? In C#, the name of the function subscribed to an event can be any you like. Solver_OnCollision is the one that Visual Studio automatically creates for you, but you could name it “MyColourfulFunction” and it would be fine RE: cloth-rope collision - maygdirf - 21-04-2022 (21-04-2022, 02:30 PM)josemendez Wrote: In C#, the name of the function subscribed to an event can be any you like. Solver_OnCollision is the one that Visual Studio automatically creates for you, but you could name it “MyColourfulFunction” and it would be fineYes, of course. I meant, like the one I have written in the code above! Ahahah |