Question by
HarryTheDesigner · Mar 31, 2016 at 09:36 PM ·
consoleconstraintsconsole errors
the console is saying my code is wrong when the code docent exist.
here what my console box says:
assets/gun animations.js(43,1):BCE0044: expecting },found".
but hears the thing, line 43 doesn't exist.
have a look:
var shoot : Animation;
var sprint : Animation;
var idle : Animation;
var aim : Animation;
var aimshoot : Animation;
function Start () {
animation.Play(idle);
}
function Update(){
if(Input.GetButtonDown("Sprint"))
{
animation.Play(sprint);
}
else if(Input.GetButtonUp("Sprint"))
{
animation.Play(idle);
}
if(Input.GetButtonDown("Shoot"))
{
animation.Play(shoot);
if(Input.GetButtonDown("Aim"))
{
animation.Play(aimshoot);
}
}
else if(Input.GetButtonUp("Shoot"))
{
animation.Play(idle);
}
if(Input.GetButtonDown("Aim"))
{
animation.Play(aim);
}
else if(Input.GetButtonUp("Aim"))
{
animation.Play(idle);
}
theres no line 43, it only goes to line 42.
PLEASE HELP!?!?!??!?!?!?!?
Comment
Answer by Doireth · Mar 31, 2016 at 09:37 PM
I'm guessing (please use the code formatter in future, your post is very hard to read) that you need to add in a new brace (}) onto line 43 to close out the script.
You're correct. In his code he's missing a final } brace. @HarryTheDesiner I suggest you use an IDE like $$anonymous$$onoDevelop or VisualStudio, as it will assist you in finding trivial issues like this.