hey i’d like to know how can I make text appear on the screen when entering a box collider and dissapearing when leaving it, thanks
you can use 3D text
a few different ways I can think of, this is what I did. It’s like a “tooltip” that pops up in my training level when a player enters a trigger zone. If you don’t want to see the text ever again after exiting add Destroy (this) . it will delete the script(which is what I should do but didn’t so I see the tooltip text popup every time I enter the trigger when I only need to see it once)
in this case the text is a component on the UI canvas that is enabled and disabled
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class seeArmText : MonoBehaviour {
private GameObject NeedArm;
private MonoBehaviour seeArm;
void Start () {
seeArm = GameObject.Find("NeedArm").GetComponent<Text>();
}
void OnTriggerEnter (Collider other) {
if(other.tag == "Player")
{
seeArm.enabled = true;
}
}
void OnTriggerExit (Collider other) {
if(other.tag == "Player")
{
seeArm.enabled = false;
}
}
}