Forum rules - please read before posting.

How to play the OnStart Cutscene only the first time the scene load?

Hello,

I have these cut scene, where the player start in a certain point and automatically walk to another.

then, the player can move around and scene and go to another one.
But when he come back to the previous scene, the cutscene play again, but it should play only the first time.
How can i do that?

I cannot use "actionlist on start game" because the first scene is the title scene, not the one i mentioned.

Comments

  • You can crea1te a local bool variable called e.g. "First time run scene" and set its initial value to true. Then in your cutscene check if the variable is true, and if it is, run the rest of the cutscene. End the cutscene with setting the variable to false. Now the next time you enter the scene, the cutscene will quit at the first variable check, because it's now false.

  • Thank you a lot!

    So another correlated question: which is the life cycle of the local variables?
    I thought they are destroyed every time the scene change.
    How long will they exist?

    If there is a link to read more about it I will appreciate it.
    Thanks!

  • Local variables are named such because they are local to the scene that they're defined in. They can be accessed while that scene is open - but not from any other scene.

    If you want access to a variable across multiple scenes, make it a Global variable.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.