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.
Hello, I’m trying to create script that will connect walls object by changing the sprite of the wall object.
For every wall I created 4 children with box colliders (Up, Down, Left, Right) to check if wall is near another object with wall tag.
But there’s my problem, I know how to check collisions and collider tag using OnCollisionEnter but I heard that it won’t work when there’s no rigidbody in any of the objects. And creating 4x rigidbody for object which will be multiplied hundred times on o…