Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Trying to add DistanceConstraint for my TearableCloth but getting IndexOutOfRange
#12
Hi!

Took a look at your project, there's a couple things that keep it from working:

1) You're not actually adding the batch to the solver. You need to call batch.AddToSolver(obiSolver); at the end of AttachParticlePairInColon().

2) You're adding the constraints in your script's Start(). When actors get added to the solver, and the constraint batches marked dirty to be rebuilt at the beginning of the next frame. So there's a pretty good chance you're adding the constraints before the batches even exist in the solver. As a result, you're adding new batches only for them to be wiped clean once the actors get added to the solver.

Either wait for one frame to add the constraints, or add them at some other point after the actors have been instantiated.

kind regards,
Reply


Messages In This Thread
RE: Trying to add DistanceConstraint for my TearableCloth but getting IndexOutOfRange - by josemendez - 05-08-2022, 07:39 AM