- Home /
Question by
Daniele · May 12, 2011 at 10:29 PM ·
errorsyntax-errorbce0044
Gun recoil/hitback animation problem
Basic animation has been made and using the following code to trigger the animation when gun is fired in game but the code doesn't seem to compile. It seems correct to me...
It responds in saying:
Assets/Code/GunAnimate.js(6,36): BCE0044: expecting ), found '{'
Assets/Code/GunAnimate.js(10,1): BCE0044: expecting EOF, found '}'
function Start(){
animation["GunAnimate"].wrapMode = WrapMode.Once;
}
function Update(){
//...
if(Input.GetButtonDown("Fire1"){//or whatever button
animation.Play("GunAnimate");
FireWeapon();
}
}
Comment
Best Answer
Answer by Owen-Reynolds · May 12, 2011 at 11:19 PM
Forgot the closing paren:
if(Input.GetButtonDown("Fire1") {
^^
I forget it about half the time, and I should know better. The long way, which makes it less likely to mess up. is:
if(Input.GetButtonDown("Fire1")==true) {
Your answer
Follow this Question
Related Questions
I need help with an error 1 Answer
error help 2 Answers
script not working 2 Answers
Script error. Please Help! 4 Answers
BCE0044: expecting ':' found ';' 1 Answer