Infinite Runner Live Training 2d collisions not working

At about 30 minutes into the Infinite Runner Live Training, Mike used a quad to make a 2d Collider to pause the game. I copied the code word for word I’m pretty sure, but the game still doesn’t pause. I have been looking over my project for about half an hour now trying to figure out what went wrong, but couldn’t find anything. I would appreciate if anyone could tell me what I am doing wrong. Thanks and here’s my code.

using UnityEngine;
using System.Collections;

public class DestroyerScript : MonoBehaviour {

	void OnTriggerEnter2d(Collider2D other)
	{
		if(other.tag == "Player")	
		{
			Debug.Break ();
			return;
		}

		if(other.gameObject.transform.parent)
		{
			Destroy (other.gameObject.transform.parent.gameObject);
		}
		else
		{
			Destroy(other.gameObject);
		}
	}
}

Since it seem nobody else is answering this question I guess I will give it a try.

I looked at the video and I noticed two things that could potentially be a problem.

  1. Your code looks like it would work but since I am not as experienced in it I’m not sure, but the code in the video did not have “return;” in the first if statement.

And 2. Is your player character tagged “Player” in the inspector? And if so does the object to collide have the collider marked as a trigger?

I got it Serenefox! Not sure what I did, I just started from scratch and watched the video again. Thanks for sticking with me throughout it all! Owe you big time!