Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Segregation of instructions to each rope at the time of collision
#1
I'm currently trying to change the color of two Obi Rope in the same Solver at their own timing when they collide with other objects.

I pasted the script below on each rope and tried it, and when one rope collided with another object, the color of the other rope was the same.

Code:
private void Solver_OnCollision(ObiSolver solver, ObiSolver.ObiCollisionEventArgs e)
    {
        foreach (Oni.Contact contact in e.contacts)
        {
            if (contact.distance < 0.025f)
            {
                    ChangeColorDark();
            }
        }
    }


Obi version 6.0, Surface-based collisions are enabled on each rope.

If I had two Obi Solvers in the scene and one rope as a child object of one Solver, the current script would work, but it would be very costly.

I would be very grateful if you could let me know if you have an elegant solution.

Thanks.
Reply


Messages In This Thread
Segregation of instructions to each rope at the time of collision - by NakanHogeri - 26-02-2021, 12:51 PM