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!
Answer by Argl · Sep 17, 2015 at 02:08 PM
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...
Your answer
Follow this Question
Related Questions
move pooled object on collision/trigger but keep pooling it 1 Answer
Which one is the most balanced and non bug Unity 5 version.? 1 Answer
Player is in range of an Item or Door and can Interact? 2 Answers
Problem to Trigger sound with OVR Player 1 Answer
Checking when two triggers intersect 1 Answer