04-11-2017, 08:03 PM
(This post was last modified: 04-11-2017, 08:05 PM by josemendez.)
Just one thing to add to what niZmo said: ObiRope already has a method to get the "real" length, including stretch:
No need to roll your own.
Also, niZmo's one would not work in case of a torn or extended/shortened rope, since particle ordering can change. The built-in method however, iterates over distance constraints instead of particles, so it will return the correct length in all cases.
Code:
float length = rope.CalculateLength();
Also, niZmo's one would not work in case of a torn or extended/shortened rope, since particle ordering can change. The built-in method however, iterates over distance constraints instead of particles, so it will return the correct length in all cases.