10-06-2025, 10:16 AM
(This post was last modified: 10-06-2025, 10:19 AM by josemendez.)
(10-06-2025, 09:40 AM)chenji Wrote: 1. You get the wrong particle (though it may work in your case sometimes, your code is actually anĀ unstable way, or a wrong way). SeeĀ https://obi.virtualmethodstudio.com/manu...ropes.html. You must use something like this to get particle position:
[size=small]int firstParticle = rope.elements[0].particle1;
[size=small]var firstPos = rope.solver.positions[firstParticle];
[color=#000000][font=Arial]
Thanks for your input chenji!
Just to clarify, elements are only needed in case you want to iterate particles in the same order they're laid out in the rope. For instance, when you want to move an object along the rope.
Alicecatalano just wants to know whether particles are inside a box, so there's no need to use elements: checking particles in any order is completely fine.