(19-11-2021, 10:22 AM)josemendez Wrote: Oh, ok. You can just remove the elements in the second piece, deactivating all particles referenced by these elements by calling rope.DeactivateParticle(index) and passing the index of the particle in the rope.For Tearing Code :
Code:
// check rope elements and tear the one that references this particle:
foreach (var elm in actor.elements)
{
if (elm.particle2 == particleIndex)
{
actor.Tear(elm);
actor.RebuildConstraintsFromElements();
DeactivateTornParticles(particleIndex);
break;
}
}
For deactivation of particles in second piece:
Code:
private void DeactivateTornParticles(int particleIndex)
{
for(int i = particleIndex; i < rope.elements.Count; i++)
{
rope.DeactivateParticle(i);
}
}
rope doing something weird, its like trying attach the cut portion, stretches long