- Home /
OnCollisionEnter stopped working
public void OnCollisionEnter(Collision col){
if (col.gameObject.CompareTag("Player")) {
Destroy (this.gameObject);
Debug.Log ("Exp Earned");
}
}
I'm getting incredibly frustrated about this. I've typed this same code millions of times over in other scripts and no problem. It's attached to a sphere with a rigidbody and a sphere collider. I'm using ufps controller. It should work, but it just doesn't. I end up just on top of the orb. I have no idea what is wrong with it
For Some reason, if I switched away from a sphere collider, it works......
Now it'll work on and off, if I have multiple copies out , some will work and some wont. Why the....gdsafhldsfgl this is frustrating
Answer by Shiro_Rin · Mar 11, 2016 at 06:50 AM
Apparently Colliders on a UFPS controller don't work well with smaller objects, so I bumped up collider size. This was so frustrating for no reason just to have a simple fix
Your answer
![](https://koobas.hobune.stream/wayback/20220612071350im_/https://answers.unity.com/themes/thub/images/avi.jpg)