- Home /
Question by
voodoo664 · Dec 13, 2013 at 04:47 PM ·
animationjavascripterror
Animation Script Error
i get these errors: Assets/Assets/Run Animation.js(14,23): BCE0044: expecting :, found ';'.
Assets/Assets/Run Animation.js(12,34): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/Assets/Run Animation.js(12,1): BCE0043: Unexpected token: if.
function Update ()
{
if (Input.GetKeyDown("d")) {
animation.Play("Run");
}
{
if (Input.GetKeyUp("d")) {
animation.Play("Idle");
}
}
Comment
Best Answer
Answer by LukaKotar · Dec 13, 2013 at 04:50 PM
At line 10, you have to get rid of the opening brace. This should compile:
function Update ()
{
if (Input.GetKeyDown("d")) {
animation.Play("Run");
}
if (Input.GetKeyUp("d")) {
animation.Play("Idle");
}
}
thank you!, im not that great at finding what causes the errors in some of my scripting.