Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two Quick Beginner Questions
#6
Thanks for the reply.
I tried your suggestions but I am very sorry that I still have problems getting the player collider. 

Code:
   void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
   {
       foreach (Oni.Contact contact in e.contacts)
       {
           // this one is an actual collision:
           if (contact.distance < 0.01)
           {
               Component collider;
               if (ObiCollider.idToCollider.TryGetValue(contact.other, out collider))
               {
                   Collider ContactCollider = ObiCollider.idToCollider[contact.other] as Collider;

                   Debug.Log(ContactCollider.transform.gameObject.name);
               }
           }
       }
   }

There is a debug log message whenever the softbody touches the ground, but there is no debug log message when the player touches the softbody.

The player has a capsule collider, a rigidbody, an obi collider and an obi rigidbody.
Reply


Messages In This Thread
Two Quick Beginner Questions - by HenryChinaski - 05-08-2019, 01:53 PM
RE: Two Quick Beginner Questions - by josemendez - 07-08-2019, 01:41 PM
RE: Two Quick Beginner Questions - by josemendez - 20-08-2019, 10:04 AM
RE: Two Quick Beginner Questions - by HenryChinaski - 20-08-2019, 04:51 PM
RE: Two Quick Beginner Questions - by josemendez - 20-08-2019, 05:22 PM