using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class txtScript : MonoBehaviour
{
public GameObject text1;
public GameObject text2;
public GameObject text3;
public GameObject text4;
//public GameObject hitbox1;
//public GameObject hitbox2;
//when the game starts
void Start()
{
text2.SetActive(false);
text2.SetActive(false);
text3.SetActive(false);
}
//starts on trigger
void OnTriggerEnter(Collider other)
{
if (Collider.gameObject.tag == ("hitbox1"))
{
text1.SetActive(false);//makes text1 disappear
text2.SetActive(true);//this makes the text visible on trigger
}
text2.SetActive(false);
text3.SetActive(true);
text3.SetActive(false);
text4.SetActive(true);
}
}
↧