Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to detect number of particles in collision?
#6
Code:
  ObiSolver solver;
    bool isHit;

    Obi.ObiSolver.ObiCollisionEventArgs collisionEvent;

    List<Oni.Contact> c;
    void Awake()
    {
        solver = GetComponent<Obi.ObiSolver>();
    }

    void OnEnable()
    {
        solver.OnCollision += Solver_OnCollision;
       
    }

    void OnDisable()
    {
        solver.OnCollision -= Solver_OnCollision;
    }

    void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
    {
       
       
        GameManager.instance.SetCompletion(e.contacts.Count);
       
    }
Basically this is attached on the Solver object, and the e.contacts.Count keeps fluctuating for some reason
Reply


Messages In This Thread
RE: How to detect number of particles in collision? - by anulagarwal - 16-07-2020, 05:37 PM