31-07-2023, 04:24 PM
Thank you! After I change the code to this it works
I've done a rope cut sequence for unlocking a chest. Any tips to improve will be appreciate!
Code:
var collider = ObiColliderWorld.GetInstance().colliderHandles[contact.bodyB].owner;
if (collider == null) return;
// retrieve the offset and size of the simplex in the solver.simplices array:
int simplexStart = solver.simplexCounts.GetSimplexStartAndSize(contact.bodyA, out int simplexSize);
// starting at simplexStart, iterate over all particles in the simplex:
int particleIndex = solver.simplices[simplexStart];
// do something with each particle, for instance get its position:
var particleInActor = solver.particleToActor[particleIndex];
// retrieve the actor this particle belongs to:
var actor = particleInActor.actor;
I've done a rope cut sequence for unlocking a chest. Any tips to improve will be appreciate!