Help Rope stretching - 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: Help Rope stretching (/thread-4101.html) |
Rope stretching - Apoll0 - 01-02-2024 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. RE: Rope stretching - josemendez - 02-02-2024 (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/manual/6.3/attachments.html kind regards, RE: Rope stretching - Apoll0 - 02-02-2024 Thank u very much, I will try all of the above! |