Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  I can't twine this object with a rope and tear the rope
#4
(11-05-2020, 09:23 AM)Warren Wrote: How to check if it is pulling?

You could simply calculate strain. Strain is a measure of how far from its rest "shape" a material is. So a strain > 1 indicates the rope is overstretched, a strain < 1 indicates compression, and 1 indicates no strain at all.

Code:
float strain = rope.CalculateLength() / rope.restLength;


Note however that using the strain to drive a rope cursor won't pull the rope back, keeping it tense at all times. I think you're going for a "Rope Around" type of game: the rope is simply longer than you see on screen, a rigidbody weight is pulling downwards. This keeps the rope tense at all times, allows the rope to become "longer" when you pull, and does not require dynamic resizing.
Reply


Messages In This Thread
RE: I can't twine this object with a rope and tear the rope - by josemendez - 11-05-2020, 09:28 AM