Hey,
I created a cutscene to trigger at the beginning of a scene. I included it in the OnStart action list, and it worked. However, the cutscene triggers every time I leave and re-enter the scene. How can I ensure it only triggers once?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
By design, OnStart will run whenever you start a scene through natural gameplay - i.e. switching to it from another scene, or beginning the game from here.
To run Actions only once, create a Local Boolean variable to keep track of whether it's been run or not.
In the Variables Manager, click the "Local" tab and create a new Boolean variable named e.g. "Played intro". Leave its default value as False.
At the top of your OnStart cutscene, add a Variable: Check Action that checks this variable's value. Only if it's False, run the rest of the Actions that make up the cutscene, and end it with a Variable: Set Action that sets the Variable to True.
The 3D Demo scene, Basement, uses this technique as well.
Thank you, Chris.