ERROR? It is not possible to invoke an expression of type 'boolean'.

function startGame() {
if (animation.isPlaying("alpha_decrease") == false) {
Application.LoadLevel("cutscene1");
}
}

what is wrong with this?
i get error: “It is not possible to invoke an expression of type ‘boolean’.”

isPlaying doesn’t take any parameters, it is in fact a property. so you can only check if a animation is playing and not if a certain animation is playing.

So you would use:

function startGame() {
if (!animation.isPlaying) {
Application.LoadLevel("cutscene1");
}
}

the ! in front is the equivalent of saying == false

Not true. IsPlaying can also take a string parameter and also returns a boolean. Just capitalize the I at the beginning to do it.

Ah, now that you mention it, I took a look at the reference again and you are correct.
The proper code is:

function startGame() {
if (!animation.IsPlaying("alpha_decrease")) {
Application.LoadLevel("cutscene1");
}
}

All that changes: isPlaying becomes IsPlaying

aahh thankyou so much! :slight_smile: