So im trying to get a “boost” particle effect working for a fighter. Now ive looked at the scripting reference and i have not been able to figure this one out. Can anyone help me
> function Update () { if
> (Input.GetButton ("Fire1") {
> particleEmitter.emit = true; }
> particleEmitter.emit = false; }
Error Console Message:
Assets/afterburner effect.js(3,39): BCE0044: expecting ), found ‘{’.
Assets/afterburner effect.js(8,1): BCE0044: expecting EOF, found ‘}’.
The importer for asset Assets/afterburner scirpt.js (MonoImporter) did not generate a MD4 digest. (i didnt get this last message)
In your if statement, you need to close off the condition properly!
if(Input.GetButton ("Fire1")) {
// do stuff
}
2. Even if it worked, you would immediately turn it back off again!
When you write an if statement, it executes the bits inside the curly brackets only in the case where the condition returns true. However, as soon as you get out of those brackets, it always executes the next bit! You should be using an 'else' statement, afterwards--