[CODING|2D] Walls that player is able to break through

I have been trying to create some code that when it detects a player in the trigger, it deactivates. I want to get to a point in which when you crash through the wall, it would slow the player down by at most 30%, but my problem right now is that when you enter the trigger, the wall the player is supposed to run into doesn’t disappear. Here’s my code so far:

public class wall : MonoBehaviour

	void OnTriggerStay (Collider attachedRigidbody)
		gameObject.SetActive (false);

	// Use this for initialization
	void Awake () {


The code is part of a sprite that does have Box Collider 2D enabled and has “Is Trigger” enabled. I am also using the player model/code included in the standard assets 2D pack. Please let me know if my wording was bad or you need more information.

For 2D Physics to work you need to use 2D messages:

void OnTriggerStay2D (Collider2D attachedRigidbody)

while we’re at it, this is better:
void OnTriggerEnter2D (Collider2D attachedRigidbody)