2D collision not working

I’m trying to make a collectible that will destroy itself once collected. problem is unlike anything I’ve coded before the object that will collide with the collectible is not moving but spawned in ontop of the collectible. (it’s a game similar to snake where the body of your snake consists of blocks and each block get’s spawned in to move “forwards”). Right now the underneath is my code and it is not tracking the collision. I’ve tried onTriggerEnter2D, onCollisionEnter2D, onTriggerStay2D and onCollisionStay2D.

anyone have a clue as to why this could be fucking up?
and no I don’t have “is trigger” checked when I’m making it into a collision detection instead.

edit: I was told to add a rigidbody2D to my snakebody and make it kinematic but it still doesn’t run the code.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CollectiblesController : MonoBehaviour
{
    public void OnCollisionStay2D(Collision2D coll)
    {
        if (coll.gameObject.tag == "SnakeBody")
        {
            Destroy(this.gameObject);
        }
    }
}

Does one of either of the two objects (the snake ‘block’ or the collectible) have a Rigidbody2D component? You need one of the objects to have a Rigidbody for collisions to register - if you don’t want it to be affected by physics, you can just make it a Kinematic rigidbody and it will just be used to register collisions :slight_smile: