Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Limit GameObject Movement with Rope
#6
(21-04-2021, 11:49 AM)gigass21 Wrote: I think i have an idea to validate to stop the movement through the script to check the length of the Rope.

I found this function, so it can't be more than a specified length. If the dog travels more than the length, i'll stop the chase.

Code:
obiRope.CalculateLength()

Does that the correct function to check the length?

I haven't tried this, but thank you for explaining. Sonrisa

Yes, this function calculates the current rope length. Note this is different from the rest length, which is the length of the rope with no stretching/compression.

Both can be used to calculate strain, which is the ratio of current length to rest length. It will be <1 if the rope is compressed, ==1 if the rope remains at rest length, > 1 if the rope is stretched.

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


Messages In This Thread
Limit GameObject Movement with Rope - by gigass21 - 20-04-2021, 11:52 AM
RE: Limit GameObject Movement with Rope - by josemendez - 21-04-2021, 12:22 PM