#pragma strict
public var scoreText: GameObject;
var spawnPoints:Transform[];
//var rigidbody: Rigidbody;
//var ballObj: Rigidbody;
public var ballObject: Rigidbody;
var spawnNum:int;
var ballNum:int;
public var myTimer : float = 15.0;
public var score: int = 0;

var SpawnScript: Spawn2;//.GetComponent(Spawn2);

//public var proj = Spawn2.proj;

function Start () {
scoreText = GameObject.Find(“scoreText”);
SpawnScript = GameObject.Find(“Main Camera”).GetComponent(Spawn2);
print(Spawn2);
Destroy(gameObject,15);
SpawnScript.LosePoints();
}

function OnCollisionEnter(col:Collision) {

if(col.gameObject.tag == “Player”) {
print(col.rigidbody);
scoreText = GameObject.Find(“scoreText”);
SpawnScript = GameObject.Find(“Main Camera”).GetComponent(Spawn2);
//audio.PlayOneShot(goodSound);
Destroy(rigidbody);
score += 10;
}
}

About the author