Hi, i know it is a frequently asked question, but i am a lost beginner. I have this (22,13): UCE0001: ‘;’ expected. Insert a semicolon at the end. and i don’t understand, i have already a semicolon on this line.
var animator : Animator;
function Start ()
animator = this.GetComponent(Animator);
function Update ()
yield return new WaitForSeconds(0.5);
Can you help me please, thanks in advance!
Move the line 4
animator.SetBool("Punching", false); somewhere else inside a function (Start?) or delete it completely and set the parameter “Punching” to false in the editor.
Also, Line 23 accesses a variable “anim”. Maybe you meant “animator”?
Edit: Finally, Line 22 uses the syntax for C# yields. (“yield return new WaitForSeconds”). The syntax for UnityScript is “yield return WaitForSecond…”. (No need to use the new operator in UnityScript).
Edit Edit: Aaand spotted another error: Look where your Update function starts and where it ends. Your function “StopAnimation” is inside the Update function. That is not legal in neither UnityScript nor C#. You have to close Update() first and then start the StopAnimation function.