#pragma strict
var cball: GameObject;
var splat:AudioClip;
var scoreText: GUIText;
var fatty: GameObject;
var an : AnimScript2 ;

function Start () {
fatty = gameObject.Find(“ballrinagame_0″);
an = fatty.GetComponent(AnimScript2);
}

function Update () {

}

function OnCollisionEnter2D(coll: Collision2D) {
if (coll.gameObject.tag == “Player”){
audio.PlayOneShot(splat);
an.HealthSubtract();
print(“collision”);
Destroy(gameObject);
print(“destroyed”);
}

}

About the author

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>