Problem with OnTriggerEnter and OnCollisionEnter

I did implement these functions as Rick did in tutorial, but now when I press left click, an instance of bullet appears, but it disappears instantly. I checked project settings, I’m looking for one hour and still couldn’t find a solution. I don’t know why bullet get triggered and destroyed as there is nothing + the bullet can’t interact with BG and the player. What could be the problem?
*I did comment by mistake on the previous episode, the episode where I met the problem is: Implement Bullet Behaviour.

I solved the problem! I’m a bit blind and I did change Layer Collision Matrix in Physics instead of Physics2D, because you have to open another tab in Physics2D to see the Collision Matrix, and I didn’t see it, so… Glad I found it, it took me around 1-2 hours.

Thanks a lot for sharing your solution. I’m sure you are not the only one who mixed up the Physics and the Physics2D settings. For 2D games, look for names with the 2D suffix (e.g. BoxCollider2D instead of BoxCollider). :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms