I checked almost every answer for this, but these were mostly simple errors and errors. My problem is that OnCollisionEnter is not called even when it collides with another rigid body.
here is the part that is not called:
void OnCollisionEnter(UnityEngine.Collision col) { Debug.Log("collision!!!"); foreach(ContactPoint contact in col.contacts) { //checking the individual collisions if(contact.Equals(this.target)) { if(!attacking) { Debug.Log("hitting target"); } else { Debug.Log("dying"); //engage death sequence } } } }
Even the "collision !!!" A message will appear. I understand that it is misused, or am I forgetting something?
c # unity3d
Erik putz
source share