10-06-2024, 09:32 AM
Hi,
yes its partially working now. As I said I have 3 ropes and all 3 of them are in contact. But the below code only giving two rope collision. I 've set ids for each rope. 1, 2 and 3 in ropeOrder variable. I am getting only 2 and 3 in logs. top rope collisioin is missing. Am I missing something ? Do I have to consider c.bodyB somewhere ?
yes its partially working now. As I said I have 3 ropes and all 3 of them are in contact. But the below code only giving two rope collision. I 've set ids for each rope. 1, 2 and 3 in ropeOrder variable. I am getting only 2 and 3 in logs. top rope collisioin is missing. Am I missing something ? Do I have to consider c.bodyB somewhere ?
Code:
foreach (var c in contacts.contacts)
{
int particleIndex = solver.simplices[c.bodyA];
ObiSolver.ParticleInActor pa = solver.particleToActor[particleIndex];
TangledRope tr = pa.actor.GetComponent<TangledRope>();
tr.collided = true;
tr.lastCollidedTime = Time.time;
Debug.Log("pa: " + pa + ", actor: " + tr.ropeOrder);
}