Ok so yet another simple javascript question.
When i collide with a coin, the coin gets removed and the GUI is updated displaying the score.
Well thats what i wish for, there are no errors and nothing is happening.
@ CollisionScript
function OnCollisionEnter(collision : Collision){
if(collision.gameObject.name == "Coin"){
ScoreScript.score ++;
Destroy(collision.gameObject,0);
}
}
@ ScoreScript
static var score : float = 0;
function Update(){
guiText.text = "Score : " + score;
}
Appreciate any feedback to what the problem is.
~Wentzel