I’ve apparently called a guiText.text that hasn’t been attatched to the object I’m using it for, but the only problem is that I don’t know where I can attatch it to or how to do so.
I’ll be more specific, because none of the methods below have worked for what I’m trying to do. I’m trying to make it that when you collide with a specific object, “You win!” is painted on the screen for an amount of time before the game ends. I attatched a guiText to the player now in order to get it to be displayed. But now when I collide with the object, nothing happens. This is my code`#pragma strict
function OnTriggerEnter (other : Collider) {
guiText.text = “You win!”;
Application.Quit();
}
function Update () {
}`
Again, I have the guiText attatched to the player, and this code is attached to the object that you are supposed to win when you collide with it.