Question by
Yukist · Apr 11, 2016 at 07:29 AM ·
unity 5javascriptscripting problemscript.script error
What's wrong with my script?
Hi! Can someone explain me why is it telling me ''UCE0001: ';' expected. Insert a semicolon at the end'' ??? I don't find anything wrong...
#pragma strict
var ToucheSol:boolean=false;
function Start () {
}
function Update () {
transform.rotation.x = 0;
transform.rotation.y = 0;
transform.rotation.z = 0;
if (Input.GetKeyDown ("space") && ToucheSol == true){
GetComponent.<Rigidbody2D>().AddForce(Vector2(0,2000));
}
function (OnCollisionEnter2D){
ToucheSol=true;
}
function (OnCollisionExit2D){
ToucheSol=false;
}
if (Input.GetKey ("right")){
transform.localScale.x = 1.380835;
transform.Translate(Vector2(0.13,0));
}
if (Input.GetKey ("left")){
transform.localScale.x = -1.380835;
transform.Translate(Vector2(-0.13,0));
}
}
Comment
Best Answer
Answer by Oribow · Apr 11, 2016 at 10:15 AM
You are missing an } to close the update function. Just insert one, after the if statements }.