Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope stretching
#1
Hello!
I am making a game with your rope asset. (It is amasing!)
So I have got several ropes with static tips on ropes endings. They have to be static because I move them with touches. I can't use physics, but I need the rope to not stretch at all. Is there a way to check the actual length of the rope so that I can stop stretching it by preventing static tip from movement?
Or is it possible to somehow monitor the stretch coefficient in real time? Also I'd like to add particles by coursor when the rope is stretching too much

PS: I tried to use dinamic attachments but then the ropes Behaviour became unpredictable.
Reply
#2
(01-02-2024, 04:59 PM)Apoll0 Wrote: I can't use physics, but I need the rope to not stretch at all.

Hi!

That's simply not possible, at least not with quite some hacking.

Assuming both ends of a rope are dynamically attached to objects, the only way a rope has to prevent stretching once it is fully taut is to stop the objects from moving. This is done (both in Obi and the real world) by applying a force to these objects, with the same magnitude but opposite direction that the force they're applying to the rope. Both forces then cancel out: the objects can no longer move in a direction that would stretch the rope further, and the rope will no longer stretch.

However, in order to apply any forces to the objects they must be physically simulated. You can't do this without physics.


(01-02-2024, 04:59 PM)Apoll0 Wrote: Is there a way to check the actual length of the rope

Code:
rope.CalculateLength();

(01-02-2024, 04:59 PM)Apoll0 Wrote: Or is it possible to somehow monitor the stretch coefficient in real time?

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

This will be > 1 when the rope is stretched, < 1 when it is compressed, and 1 when not under any forces/acceleration.

(01-02-2024, 04:59 PM)Apoll0 Wrote: PS: I tried to use dinamic attachments but then the ropes Behaviour became unpredictable.

Maybe you've attached it very close to/inside a collider? that will cause the rope to fight between being inside the collider (attached) or outside the collider. See "attachments inside colliders": http://obi.virtualmethodstudio.com/manua...ments.html

kind regards,
Reply
#3
Thank u very much, I will try all of the above!
Reply