02-02-2024, 01:08 PM
(This post was last modified: 02-02-2024, 01:10 PM by josemendez.)
(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,