Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How can I detect my second actor in a solver?
#1
Pregunta 
Hi, I am working on a project where I need to check if a rope is colliding with another rope, if not I will then destroy that rope after enough frames without collision passes.

It is very similar to how `TangledRopes.unity` sample works. I access the solver and on `Solver.OnParticleCollision()`event I call my collision checker function, here's a snippet of the code and my issue:

 
Code:
private void Solver_OnParticleCollision(ObiSolver solver, ObiNativeContactList contacts)
{
for (int i = 0; i < contacts.count; ++i)
{
    var ropeA = solver.particleToActor[solver.simplices[contacts[i].bodyA]].actor;
    var ropeB = solver.particleToActor[solver.simplices[contacts[i].bodyB]].actor;

    if (ropeA == ropeB) //Always true for some reason
    {
        //Breakpoint
        continue;
    }

    //Do Something
}
}


I never can access to the "Do Something" part of the code. In my debugging I found that EVERY contact is from `Rope_0` and none is from `Rope_1`. The ropes are on top of eachother, even twisted together. They are under the same solver. They are both in group 0 in particles and points in blueprint.

Why may this be?
Reply


Messages In This Thread
How can I detect my second actor in a solver? - by anthony_dev - 27-03-2025, 04:05 PM