29-04-2025, 07:27 AM
I tried something like this:
I instantiated a rope and saved it in a "long" form via a blueprint (to ensure a higher particle count). This way, I no longer needed to add new particles to rope.elements. Specifically, I commented out the following code block:
By doing this, I could adjust the rope’s particle count by only removing particles, without adding new ones. However, I’m still unsure how to handle cases where I do need to add new elements.
Thanks!
I instantiated a rope and saved it in a "long" form via a blueprint (to ensure a higher particle count). This way, I no longer needed to add new particles to rope.elements. Specifically, I commented out the following code block:
Code:
// while (rope.elements.Count < particleCount)
// {
// rope.elements.Add(new ObiStructuralElement
// {
// particle1 = rope.elements[^1].particle1,
// //particle2 = rope.solverIndices[rope.activeParticleCount],
// restLength = rope.interParticleDistance
// });
// rope.CopyParticle(rope.activeParticleCount - 1, rope.activeParticleCount);
// rope.ActivateParticle();
// }
By doing this, I could adjust the rope’s particle count by only removing particles, without adding new ones. However, I’m still unsure how to handle cases where I do need to add new elements.
Thanks!