OnTriggerEnter help

Hi!

I am making some kind of infinite runner game and I need it to destroy backdrops that is behind the camera. I made a simple script that would do this but it doesn’t work.

Here is the function

void OnTriggerEnter(Collider other){
		if(other.tag == "Backdrop"){
			Destroy(other.gameObject);
		}
	}

And yes, the backdrop does have the tag “Backdrop” and a Box collider.

Thanks in advance

Is the isTrigger checked on the collider for your “Backdrop” ?

Add a (non-kinematic) rigidbody component to your Destroyer.