I want the objects with the tag “Appear” to be invisible (meshrenderer off) on game start.
But I want them to become visible once the player has passed through a trigger.
using UnityEngine;
using System.Collections;
public class Trig1 : MonoBehaviour {
public GameObject Appear;
void start()
{
Appear = GameObject.FindGameObjectWithTag ("Appear");
Appear.GetComponent<MeshRenderer> ().enabled = false;
}
void OnTriggerEnter(Collider other)
{
Appear.GetComponent<MeshRenderer>().enabled = false;
Debug.Log ("Object has entered the trigger!");
}
}
Could you help identify what I’m doing wrong?