Bug / Crash Rope cutting with 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 Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Bug / Crash Rope cutting with collision (/thread-3950.html) |
Rope cutting with collision - spikebor - 31-07-2023 Hello, I've copied the code in another Post to implement cutting Rope with collision. It does cut the rope, but some rope does not get cut. Turn out when I check the debug.log, it always cut the Rope02, but when I check in Inspector, the actual Rope is colliding with the cutter is Rope. This implies my method of specify the Rope from solver.simplices and solver.particleToActor return wrong result. I'll attached the project, please take a look. https://drive.google.com/file/d/12hSpnv0v2i0Tcwye-diDejfGeRmE_aGC/view?usp=sharing Please check this video for more info Code: private void TryTearRope(Oni.Contact contact) RE: Rope cutting with collision - josemendez - 31-07-2023 Hi! If your ropes are using surface collisions (I'd be inclined to think they do, since they seem copied from the "RopeCutting" sample scene and the ropes in that scene use surface collisions), then you can't assume each simplex is made out of a single particle like you do here: Code: // get the particle index: This will lead to incorrect results. The manual explains how to retrieve all particles in each simplex in the general case. See "Retrieving the particle involved in a contact": http://obi.virtualmethodstudio.com/manual/6.3/scriptingcollisions.html let me know if you need further help, kind regards RE: Rope cutting with collision - spikebor - 31-07-2023 Thank you! After I change the code to this it works Code: var collider = ObiColliderWorld.GetInstance().colliderHandles[contact.bodyB].owner; I've done a rope cut sequence for unlocking a chest. Any tips to improve will be appreciate! |