Collision Detection Not Working (Unity 5.2.3)

Hello!

I have been making a game, and I’m at the point of which I’m adding in Enemy AI who swing and attack the player. Unfortunately, I can’t get the detection to work. Collision is pretty rudimentary, but for whatever reason, it’s not clicking. I have been reading several articles online, trying to understand why it’s not working, but nothing I have read has bore a viable solution.

For the record, both the enemy AI and player have Mesh Colliders, neither of them have the “Trigger” option or the convex option selected. Both have Rigidbodies. I put a debug.log bit in my code to see if it would detect anything, and it does not…If I’m missing something, please let me know.

using UnityEngine;
using System.Collections;

public class EnemyManager : MonoBehaviour {

	void OnColliderEnter(Collision coll) {
		Debug.Log ("Object Detected");
		if (coll.gameObject.tag == "Player") {
			Debug.Log ("Hit Player");
		}
	}
}

I’m not quite sure why that is not working but what you could always do is put a boxcollider around them and just make it a trigger and see if it works that way.

I could do that for test purposes, but that wouldn’t work in game, as I don’t want it to be a constant damage, only when they are swinging. I’ll try it for test sakes.

Also, I noticed I had typed in OnColliderEnter, I have changed it to the correct OnCollisionEnter.

I had the same problem. I downgraded to version 5.2.2 and everything was working fine. I assume this is a bug in the 5.2.3 version.

Same issue here. 5.2.3 broke all collision in our game.

Same issue here. All collision broken on Android from 5.2.3 till 5.3.2
On PC and Editor working normal

Downgrade to 5.1 or 5.2 solving this issue.