I have a new issue:
If I cut the rope than the below scripts not give me the correct last particle position.
Can you help me in this?
private int GetFirstParticleIndex() => rope.elements[0].particle1;
private int GetLastParticleIndex() => rope.elements[rope.elements.Count - 1].particle2;
and
public void CutRopeAtIndex(ObiRope rope, int particleIndex)
{
if ((DateTime.Now - _lastTimeCut).Milliseconds > 100)
{
if (particleIndex < rope.elements.Count)
rope.Tear(rope.elements[particleIndex]);
rope.RebuildConstraintsFromElements();
_lastTimeCut = DateTime.Now;
}
}
How can I get the cutted rope (that remains in the air, and not on the ground) last particle?
If I cut the rope than the below scripts not give me the correct last particle position.
Can you help me in this?
private int GetFirstParticleIndex() => rope.elements[0].particle1;
private int GetLastParticleIndex() => rope.elements[rope.elements.Count - 1].particle2;
and
public void CutRopeAtIndex(ObiRope rope, int particleIndex)
{
if ((DateTime.Now - _lastTimeCut).Milliseconds > 100)
{
if (particleIndex < rope.elements.Count)
rope.Tear(rope.elements[particleIndex]);
rope.RebuildConstraintsFromElements();
_lastTimeCut = DateTime.Now;
}
}
How can I get the cutted rope (that remains in the air, and not on the ground) last particle?