Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make the Start/End Prefab able to be Raycasted?
#15
Perfect, it works great. Now i have a problem to remove the pinned constraints Indeciso
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?
Reply


Messages In This Thread
RE: How to make the Start/End Prefab able to be Raycasted? - by Rexima - 04-11-2017, 04:21 PM