OnTriggerEnter

using UnityEngine;
using System.Collections;

public class Beam : MonoBehaviour {
	public Transform spwanpoint;
	public bool Create = true;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	if(Create == true){
		transform.localScale += new Vector3(0, 0, 10);
		}else{
		}
	}
	void OnTriggerEnter(Collider  other){
		if (other.gameObject.CompareTag( "Wall"))
    {
			Debug.Log("I got hit");
			Create = false;
		}
	}
}

The problem is that the doesn’t call the things in “if (other.gameObject.CompareTag( “Wall”))”.
If I delete that if statement then when a collider enters it works. So I don’t really know what I’m doing wrong.

Is that script attached to the wall or the object that’s supposed to enter the wall?

You talk about OnTriggerEnter… but the code shows OnTriggerExit

That and did you attached a rigidbody on either object that will collide?

Attaching a Rigidbody did the trick thanks