Good day sir Tony.
I would like to build a topic that focuses on the title above.
So, my first question is:
How would I set my Lua Variable back to 0 every time the level loads?
In my case, I used the Set Lua Variable block but it does not set back right to 0.
I have ExoPlanets variable, In level one. The player must collect all 10.
If the level is completed then retried level one. It already results to 10 which should be 0.
Dialogue System and plyGame: Level Selection Type of Game
-
- Posts: 57
- Joined: Sun Feb 12, 2017 2:11 pm
Re: Dialogue System and plyGame: Level Selection Type of Game
Hi David,
Add a Lua Trigger to your scene. You can add it to an existing, active GameObject or a new, empty GameObject. Set the Trigger to OnStart. Set the Lua code to:
This will reset ExoPlanets to 0 when the scene starts.
Add a Lua Trigger to your scene. You can add it to an existing, active GameObject or a new, empty GameObject. Set the Trigger to OnStart. Set the Lua code to:
Code: Select all
Variable["ExoPlanets"] = 0