08-07-2024, 01:15 PM
(08-07-2024, 12:02 PM)josemendez Wrote: Hi!Thank you very much! This should help.
You can get any per-particle value (velocity, position, size, etc) using the particles API. To get the index of the first particle on the rope, you should use the rope's elements array.
By definition, the tension at rest or any object is zero. Maybe you're interested in strain instead, which is the % of deformation caused by tension? You can calculate it like this:
Code:float strain = rope.CalculateLength() / rope.restLength;
It will be 1 when the rope is at rest, >1 if stretched, <1 if compressed.
kind regards