Having difficulties making a block be a death trigger for a ball.

I am working on a pretty simplistic game right now, and this is really impeding my ability to finish this project. I am trying to get a block to be a trigger so when the ball hits the block, the ball get’s destroyed and respawns. I have tried probably every tutorial on YouTube, no scripts worked. Can you make a tag that you can put on an item that makes it a death trigger?

If you need more information, I will provide it.

Thank you.

hello there,

you need to do the following:
1- this code should be on the death box if it is not

 void OnTriggerEnter(Collider col){
          Destroy(col.gameObject);
          }

2-add a collider to both the death box and the player (if they dont have it already)
3-tick the trigger box that is on the death box

additional : add a tag to the player and call it “Player”
then change the code to be like :

void OnTriggerEnter(Collider col){
if(col.tag=="Player")
          Destroy(col.gameObject);
          }

Hope it helps

@MiloRoban
Here’s the 4 things that need to be in place in order for your code to work:
1: have your code (as in the examples above) on the death trigger :

void OnTriggerEnter(Collider col){
               Destroy(col.gameObject);
    }

2: Add a collider to the death trigger and check the check box for trigger. Also add a collider to your ball.

3: The one thing that everyone else missed is that YOU NEED TO HAVE Rigidbody component on your ball object. Without one it wouldn’t work.

Bonus: Make sure their layers are seeing eachother in the Edit>Project Settings>Physics.

Good luck!