Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rope limit
#1
Bombilla 
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);
                }
            }
Reply
#2
(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/tutor...setup.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.
Reply
#3
(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/tutor...setup.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
Reply