Void OnCollisionEnter not working

Hi guys,
I’m having a unique problem with the function:

Void OnCollisionEnter()

None of the other forum posts seemed to match what I had, because what I found was that the function wasn’t being called. I used a “print” function to test this. I know this might be a collider issue, but this doesn’t seem to be the case. Here’s my code:

	void OnCollisionEnter (Collision col)
	{
		if(col.gameObject.tag == "climb")
		{
			Destroy(col.gameObject);
		}
	}

I have a first person character with an additional sphere collider (set for trigger only) and all of the other objects I’m running into have the default colliders. Do any of you know why the function is not being called?

P.S. I’ve used this function before with success, which is why it surprises me that it doesn’t work now.

@ViolinRobot this should be a super easy fix, If the sphere collider is set to Is Trigger, then instead of useing “void OnCollisionEnter (Collision col)” , Use “void OnTriggerEnter (Collider col)”, so your code should look like

      void OnTriggerEnter (Collider col)
      {
          if(col.gameobject.name == "climb")
          {
              Destroy(col.gameobject);
          }
      }

I hope this helps :slight_smile: