Obi Official Forum
Rope limit - 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: Rope limit (/thread-2580.html)



Rope limit - JskT01 - 19-11-2020

When increasing the length of my rope after 13.92 it does not continue to grow even though the limit (max) is set at 15 or more, I have 4 ropes on scene
Code:
if (Input.GetKey(KeyCode.K))
            {
                if (ropeExtrude.restLength < max)
                {
                    for (int i = 0; i < cursor.Length; ++i)
                    {
                        cursor[i].ChangeLength(ropeExtrude.restLength + speed * Time.deltaTime);
                    }
                    Debug.Log(ropeExtrude.restLength);
                }
            }



RE: Rope limit - josemendez - 19-11-2020

(19-11-2020, 03:38 PM)JskT01 Wrote: When increasing the length of my rope after 13.92 it does not continue to grow even though the limit (max) is set at 15 or more, I have 4 ropes on scene
Code:
if (Input.GetKey(KeyCode.K))
            {
                if (ropeExtrude.restLength < max)
                {
                    for (int i = 0; i < cursor.Length; ++i)
                    {
                        cursor[i].ChangeLength(ropeExtrude.restLength + speed * Time.deltaTime);
                    }
                    Debug.Log(ropeExtrude.restLength);
                }
            }

Make sure you have enough pooled particles in your rope blueprint to be able to continue extending the rope. See:
http://obi.virtualmethodstudio.com/tutorials/ropesetup.html

Quote:Pooled particles: (Ropes only). Extra particles allocated to be used when tearing or resizing the rope. You can set this value to zero if you do not plan on tearing or resizing the rope at runtime, as no extra particles besides the initial ones will be needed.

The reason behind pre-allocating a particle pool instead of just creating new particles at runtime is that allocating memory is slow and causes GC spikes.


RE: Rope limit - JskT01 - 19-11-2020

(19-11-2020, 03:48 PM)josemendez Wrote: Make sure you have enough pooled particles in your rope blueprint to be able to continue extending the rope. See:
http://obi.virtualmethodstudio.com/tutorials/ropesetup.html


The reason behind pre-allocating a particle pool instead of just creating new particles at runtime is that allocating memory is slow and causes GC spikes.
Thanks it´s working