-1

I want the lights to be activated a little after "me" has been activated.

public class LightsOut : MonoBehaviour

{

    public GameObject NextTrigger;

    public GameObject Voiceline;

    public GameObject Me;

    public GameObject Lights;



    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            NextTrigger.SetActive(true);
            Voiceline.SetActive(true);
            Me.SetActive(false);
            Lights.SetActive(false);
        }
    }

}
halfer
  • 19,824
  • 17
  • 99
  • 186
grippel
  • 11

1 Answers1

1

Try to use

StartCoroutine(ActivateLight())

And add a method

IEnumerator ActivateLight()
{
    yield return new WaitForSeconds(1f);
    Lights.SetActive(true);
}
Igor Belikov
  • 248
  • 2
  • 8