I’m following a tutorial on youtube I did exactly the same thing and the video appeared this error in this script
Assets/Game_data/Scripts/Coin.js(16,1): BCE0044: expecting ), found ‘{’.
#pragma strict
var player : Transform;
function Start () {
}
function Update () {
}
function OnCollisionEnter(collision : Collision)
{
if(collision.transform == player
{
Destroy(gameobject);
}
}
The line:
if(collision.transform == player
Should have a closing ) as shown below:
if(collision.transform == player)
In programming its important that whenever you ‘open’ something by using { or ( then you must have a matching } or ) .
The error message you got indicates this was the problem:
Assets/Game_data/Scripts/Coin.js(16,1): BCE0044: expecting ), found ‘{’.
Also a helpful tip is that in Unity3D you can get to the exact line causing an error if you double click on the error in the debug log.