Obi Official Forum
How to make the Start/End Prefab able to be Raycasted? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: How to make the Start/End Prefab able to be Raycasted? (/thread-217.html)

Pages: 1 2 3


RE: How to make the Start/End Prefab able to be Raycasted? - josemendez - 06-11-2017

(05-11-2017, 10:44 PM)Rexima Wrote: Thank you very much, i got everything working, like i planned.
But i have at least one question, is it possible to check if the rope is stretched?
Is there any function to check if im stretching the rope?

Easiest way:

Code:
float strain = rope.CalculateLength()/rope.RestLength;
// strain == 1: no stretch, strain > 1: stretch, strain < 1: compression

the larger "strain" is, the more you're stretching the rope.


RE: How to make the Start/End Prefab able to be Raycasted? - Rexima - 07-11-2017

Thank you very much, it works now!