CTIN 289 - Interactive Snippets Library

Powered by 🌱Roam Garden

Unity Collision Debugging

// Unity Collision Debugging
public class Reporter : MonoBehaviour 
{

   private void OnCollisionEnter(Collision collisionInfo) {
      print(“collision btw me (” + gameObject.name + “) and ” + collisionInfo.collider.name);
   }

   private void OnTriggerEnter(Collider otherCollider) {
      print(“trigger collision btw me (” + gameObject.name + “) and ” + otherCollider.name);
   }

}