05-08-2022, 07:39 AM
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,
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,