ON TRIGGER ENTER GAME OBJECT SET ACTIVE TRUE

hi i need help. i want to set a object to true or false when player enters the collider. here are my codes

public class enterexit : MonoBehaviour {

public GameObject trigger;

void Start()
{
trigger.SetActive(false);
Debug.Log(“sdafasd”);
}

void OnTriggerEnter (Collider player)

{

if (player.gameObject.tag == "Player")

{

	trigger.SetActive(true);

}

}

}

Hi, this is my version:

public GameObject trigger;

void Start () {
		trigger.SetActive (false);
	}

void OnTriggerEnter(Collider _col){
		if (_col.gameObject.CompareTag ("Player")) {
			trigger.SetActive (true);
				}
		}

If you need a Trigger exit:

void OnTriggerExit(Collider _col){
		if (_col.gameObject.CompareTag ("Player")) {
			trigger.SetActive (false);
		}
	}