Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  A few technical questions
#3
This code gets that available points inside the rope


Code:
       //ObiRope rope = obiRopeObj.GetComponent<ObiRope>();
       //ObiPinConstraintBatch pinConstraints = rope.PinConstraints.GetFirstBatch();
       //pinConstraints.AddConstraint(0, startConnectedObj.GetComponent<ObiCollider>(), startConnectedObj.transform.localPosition, Quaternion.identity, 0);
       //pinConstraints.AddConstraint(rope.UsedParticles - 1, endConnectedObj.GetComponent<ObiColliderBase>(),
       //                                                  endConnectedObj.transform.InverseTransformPoint(endConnectedObj.transform.position), Quaternion.identity, 0);


All theory here:
You could potentially loop through the batch of pinConstraints (rope.UsedParticles -1 is max size) and lock pins in to place by feeding them a Vector3 location. If you want it spaced evenly then you could take the distance and divide it by the usedparticles - 1. That would space it out equally. If you want, use a lerp function in a coroutine to find your desired points in space at run time. As you lerp to each new point, pin the particle at that location.
Reply


Messages In This Thread
A few technical questions - by Adrian_GSO - 12-09-2019, 10:39 AM
RE: A few technical questions - by Adrian_GSO - 24-09-2019, 02:08 AM
RE: A few technical questions - by BisuDagger - 24-09-2019, 07:27 PM