Hi guys, I’m new on using Unity and currently I’m developing an simple game,
This is my code and I want to know how can I stop the if Statement from looping?
var guiScore:GUIText;
function Start () {
guiScore.text= "Points : 0 ";
}
function Update () {
if (Input.GetKeyDown (“a”))
{
PlayerScore +=1 ;
socreText= PlayerScore + " " + "Points" ;
guiScore.text = PlayerScore + " " + “Points”;
questionTexture.enabled = false;
}
if (Input.GetKeyDown (“b”))
{
textAnswer.enabled=true;
questionTexture.enabled = false;
}
}
function OnTriggerEnter(hit : Collider){
if(hit.gameObject.tag == “cube”)
{
questionTexture.enabled = true;
Destroy (hit.gameObject);
}}