Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Issue Saving/Loading Particle Positions in play mode using ObiRope v7.0
#2
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:

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!
Reply


Messages In This Thread
RE: Issue Saving/Loading Particle Positions in play mode using ObiRope v7.0 - by ozeecode - 29-04-2025, 07:27 AM