I am not detecting any collisions

Hello everyone,

i want to make a Snake game. I am new to the Engine and i am just trying to do some “exercises” to get to know the engine better.
I am trying to make an Apple that moves when the Snake hits it. The OnCollisionEnter2D method is not being called and i have no idea why.
Here is a link to a download for the project, for anyone who wants to take a look at it.

(Feel free to correct me on anything that is done stupid)

Make sure one of the two (snake or collectible) has both a Rigidybody2D and Collider2D (of some kind). They both need Collider2Ds but one of them needs Rigidbody2D.

I use a CharacterController to move the Snake, which stops me from adding a Collider2D.

It is not called probably the objects are not colliding. Since is 2D can be that in different 3D positions?
Take a look at the physics learning section. This helps me a lot!
https://learn.unity.com/tutorials/?k=[“lang:en”,“tag:5813f57532b30600250d6e0d”]&ob=starts

Do not use CharacterController for a 2D. It is designed for 3D.

Snake is a difficult game to make since you have to track back your steps to let the body follow the head. Therefore it’s hard to write a exsample script you can use. Maybe look at a vid from Coding train where he makes it. It’s in Javascript but if you transform it into c# it should work for you.

i don´t think it helps on anyway, but here is doing some1 snake in 4min 30sec, with JS :smile: