The full error is Assets/Control.js(15,49): BCE0044: expecting ‘"’, found ‘\r’.
Here’s my script. Any help?
#pragma strict
function Start () {
var randomnumber = Random.Range(0, 2);
if (randomnumber <= 0.5) {
rigidbody2D.AddForce (new Vector2 (80, 10));
}
else {
rigidbody2D.AddForce (new Vector2 (-80, -10));
}
}
function OnCollisionEnter2D (colInfo : Collision2D) {
if (colInfo.collider.tag == "Player) {
Debug.Log "works"
}
}
Line 15 and 16 should be:
if (colInfo.collider.tag == "Player") {
Debug.Log ("works");
}