Perfect, it works great. Now i have a problem to remove the pinned constraints
How do i get the index, when i pinned a constraint?
For example, when i try to remove it with this
Edit: Actually im solving it like this, but it's not the best option to remove both constraints.
I remove for each end the previous pin and not like expected for the startprefab the both constraints.
And is it also possible to get some informations, if the rope is stretched?
How do i get the index, when i pinned a constraint?
For example, when i try to remove it with this
Code:
batch.RemoveConstraint(0);
batch.RemoveConstraint(1);
Edit: Actually im solving it like this, but it's not the best option to remove both constraints.
Code:
for (int i = 0; i < batch.ConstraintCount; i++)
{
if(batch.pinBodies[i] == m_obiCollider)
{
batch.RemoveConstraint(i);
}
}
for (int i = 0; i < batch.ConstraintCount; i++)
{
if (batch.pinBodies[i] == m_obiCollider)
{
batch.RemoveConstraint(i);
}
}
I remove for each end the previous pin and not like expected for the startprefab the both constraints.
And is it also possible to get some informations, if the rope is stretched?