Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Disabling Particle and obi collisions in run time.
#3
(20-03-2018, 09:50 AM)josemendez Wrote: It depends on what level of granularity you need. If you just want to disable all interactions with all rigidbodies and ropes, you can disable particle collisions and regular collisions globally in the solver:

Code:
solver.particleCollisionConstraintParameters.enabled = false;
solver.collisionConstraintParameters.enabled = false;
solver.UpdateParameters();

You could also simply move the colliders you want to skip collisions with to a different layer that's not marked as a collision layer in the solver, or set their phase to be the same as the rope's.

Code:
obiCollider.phase = 1 //assuming your rope particles have a phase value of 1 too.

Interesting, as that is what I had in my code word for word, and yet it visibly disables the components in the solver inspector but the collisions continue regardless.

EDIT: To give you the full scope of what I am striving to achieve, I have a UI toggle that sets a bool for if the collisions should be set or not in the ropes generator, I set the parameters for the rope and set the obisolver collisions to reflect the value that was altered by the ui toggle.

The ropes only use the collision parameters at the time of starting the game, although when the parameters are set by the generation code the solvers inspector changes but the collisions only act depending on the solvers components state at first run.

I am using solver.updateParameters() but the parameters are not updating correctly.
Reply


Messages In This Thread
RE: Disabling Particle and obi collisions in run time. - by Gieve - 20-03-2018, 09:55 AM