Hey all. I just made this script, however I'm getting some errors. I want the player to click a cube tagged "Paper" and I want a seperate gameobject with a GUI texture to appear. How can I fix these errors?
1. (8,29): BCE0043: Unexpected token: paper.
2. (8,27): BCE0044: expecting ), found '='.
var email : GUITexture;
function Start() {
email.enabled = false;
}
function OnMouseDown(){
if(gameObject.tag = "paper")){
email.enabled = true;
}
}
function Update() {
if(Input.GetKeyDown(KeyCode.E))
{
email.enabled = false;
}
}
↧