Obi Official Forum
Setting the length of rope during run time instantly (not gradually growing it) - 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: Setting the length of rope during run time instantly (not gradually growing it) (/thread-4099.html)



Setting the length of rope during run time instantly (not gradually growing it) - Mulbin - 31-01-2024

Is this possible? I'd like to, for example, have a rope that is 3 meters long, then make it instantly 20 meters long. Rather than gradually extending it.


RE: Setting the length of rope during run time instantly (not gradually growing it) - josemendez - 31-01-2024

(31-01-2024, 03:10 PM)Mulbin Wrote: Is this possible? I'd like to, for example, have a rope that is 3 meters long, then make it instantly 20 meters long. Rather than gradually extending it.

Hi!

Yes, using a ObiRopeCursor component this is the default behavior. For instance: to set the length to 20 meters, just add a cursor to the rope and call cursor.ChangeLength(20).

It will only change gradually if instead of setting a fixed length you add to its length over time, see the "Crane" sample scene for an example of this.

Note that your blueprint must have enough pooled particles to reach the length you set (see: http://obi.virtualmethodstudio.com/manual/6.3/ropesetup.html). Also note that the newly added particles will be in the same place as the target one, so if you need to place them in any specific position you must do so manually. You have another example of this in the "GrapplingHook" sample scene.

kind regards,


RE: Setting the length of rope during run time instantly (not gradually growing it) - Mulbin - 31-01-2024

Great thanks, I'll look into that. I'm making an extendible hose which needs to get longer as you pull one end away (a bit like the power cord on a vacuum cleaner)... but I also don't want it taught, it should flop to the ground... so planning to get the distance from the root to the "plug" and always keep it a little longer than that so there is some slack.