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.
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.