- Home /
Duplicate Question
Why am i getting this error?!
Assets/Scripts/breathingSystem.js(17,1): BCE0044: expecting EOF, found 'else'.
var movingSound : AudioClip;
var idleSound : AudioClip;
var isMoving : boolean = false;
var isIdle : boolean = true;
function Start ()
{
if(Input.GetKeyDown("Vertical") || Input.GetKeyDown("Horizontal"))
isIdle = false;
isMoving = true;
audio.clip(movingSound);
audio.Play();
}
else if(Input.GetKeyUp("Vertical") || Input.GetKeyUp("Horizontal"))
{
isIdle = true;
isMoving = false;
audio.clip(idleSound);
audio.Play();
}
These are all duplicate questions :
http://answers.unity3d.com/questions/428154/why-am-i-getting-this-error-2.html
http://answers.unity3d.com/questions/428203/if-var-true-do-something-not-being-detected.html
http://answers.unity3d.com/questions/428237/audio-says-it-is-playing-in-audiosource-but-is-not.html
@inglipX : Do Not Post Duplicate Questions
Watch : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers
Answer by Unitraxx · Mar 30, 2013 at 09:50 PM
at the end of line 8 should be a {
And you also miss one {
at the end of your file to close the Update()
function
Answer by DryTear · Mar 30, 2013 at 10:40 PM
heres the layout of a javascript:
var Thing : Transform;
function Update()
{
if(Thing.name == "Thing")
{
Destory();
}
else
{
Destroy(Thing.gameObject);
}
}
if you follow the structure it can help you
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
'else' not working.... please help:( 4 Answers
varification error in editor script 1 Answer
Wall Issue 1 Answer