15-08-2017, 11:18 AM
(14-08-2017, 02:04 AM)gxiv. Wrote: Hi!
What is the method for dynamically adding pin constraints to a rope??
I've tried creating an ObiPinConstraintBatch object, using the AddConstraint function, and then using AddBatch to add the pinconstraintbatch to the ropes pin constraints. I reference the pin constraints of my rope with:
pinConstraints = swingRope.GetComponent<ObiPinConstraints> ();
Is this the proper way of doing this? Because what I've written appears to have no affect! I would appreciate any help!!
gxiv
Hi,
Check out the manual page on how to add/remove constraints:
http://obi.virtualmethodstudio.com/tutor...aints.html
You should not create a new batch, as there's already an empty one by default on all actors. You just:
- Remove the constraints from the solver.
- Get a reference to the first pin constraint batch.
- Add/remove constraints from the batch.
- Add back the constraints.