on trigger Enter

when i use of below code,it’s will not trigger with the right box.in other world the (OnTriggerEnter)function isn’t work.i used of debug.log for ensure that.


using UnityEngine;
using System.Collections;

public class boxScript : MonoBehaviour {
	
	public int speed = 2;
	bool done;
	// Use this for initialization
	void Start () {
	done=true;
		
	}
	
	// Update is called once per frame
	void Update () {
	
		if(done==true)
		{	
			transform.Translate(Vector3.right*Time.deltaTime*speed);
			
		}
	}
	
	void OnTriggerEnter(Collider other)
	{
		
		if(other.gameObject.tag == "rightBox")
		{
                        done=false;
                        Debug.Log ("trigged");
			transform.Translate (Vector3.left*Time.deltaTime*speed);
			
		}
		
		
		if(other.gameObject.tag == "leftBox")
		{
			transform.Translate (Vector3.right*Time.deltaTime*speed);
		}
	
		
	
	}
	
}

4162-untitled.jpg

If the right box is the one selected in the image above, apparently it’s not tagged as “rightBox” - it seems to be untagged.