Rogue Like 2D - OnTriggerEnter2D fails

Hello,

I’m following the tutorial Rogue Like 2D and I’m at step 11. I’ve carefully followed all instructions but when I test the game (as he does at the end of the 11th video) my character doesn’t pickup the food and soda as he’s supposed to.

I’ve look into the OnTriggerEnter2D function and it is never actually triggered. I’ve searched all around for possible fix:

  • Correctly spelling OnTriggerEnter2D (done)
  • Having at least one rigidbody on one of the colliding agent (in my case, it’s the Player)
  • Having all the scripts concerned attached to the concerned prefabs (done)
  • Check/uncheck “Is Kinematic” or “isTrigger” on the components, doesn’t fix the problem for me.

What am I missing?

Here are the two component which should collide and the concerned function:

I’ve restarted the tutorial from the beginning, compared with the source code he provided, I don’t see the difference… Maybe I’m not looking in the right places, If you have any thoughts on what else could be the cause of the issue, that would be very nice!

Just in case, a friend found the problem a minute ago:

I was disabling the boxCollider of the main character upon moving him, and forgot to enable it afterward…