script woe adding score

//My Code
var playerScore : int = 0;
var writing : GUIText;

function OnCollisionEnter(collision : Collision) {


writing.text = "Score: " + playerScore;


The problem is that when you run you OnCollisionEnter() function, you call Destroy(this.gameObject) before you are even able to increment your score. This means it will not work as this script is attached as a component of your object instance and is destroyed along with your object. I would suggest either changing you execution order so that it increments before the Destroy() method call, or else controlling your score in another script altogether (I would go with the latter).

Hope that helps,