I'm new to coding so I have no idea what I'm doing besides what I've had to do in like... the last three days. I just want the player to walk into a collider to trigger a Canvas UI, and then have the Canvas disappear when you exit the collider. Here is my code so far:
// JavaScript source code
function OnTriggerEnter(Col : Collider)
{
if(Col.tag == "Player")
{
myCanvas.active = true;
}
}
function OnTriggerExit(Col : Collider)
{
if(Col.tag == "Player")
{
myCanvas.active = false;
}
}
Even though I didn't get any errors and it plays, I'll enter the collider area and the Canvas won't show up, and when I exit the collider it's like it exits out of play mode... Help, please?