Hi people, I’m rather new to Unity and programing. While finishing up a tutorial I decided to mix things up and try something out but I get 3 errors on this code chunk.
-
Expecting(,found ‘OnCollisionEnter’
-
Unexpected token:col.
-
Expecting }, found". (at the end of the code chunk)
I would be grateful for any help I can get.
function Start () {
}
function Update () {
function OnCollisionEnter (col:Collision);
{
if (col.gameObject.tag == "Brick")
{
audio.PlayOneShot(bricksound,0.5);
Destroy (col.gameObject);
if (Gamecontroller.score >=0)
{
Gamecontroller.score = Gamecontroller.score + 10;
}
}
}