frog,
i would not recommend using a global int or code in the repeatedly executed section. both of those should be used sparingly. you should keep you variables as local as possible to reduce confusion (even to yourself). and you should avoid repeatedly executing commands that don't need to be repeatedly executed. if you programmed everything this way, your game could really chug...and it could get confusing to have code spread out in unexpected places like this.
if all he wants to do is see smoke when he leaves the room, then why not turn the object on THEN...run the animation...then turn the object off? no need for any global vars, no need for any script being executed 60 times a second for the duration of the game.
i would not recommend using a global int or code in the repeatedly executed section. both of those should be used sparingly. you should keep you variables as local as possible to reduce confusion (even to yourself). and you should avoid repeatedly executing commands that don't need to be repeatedly executed. if you programmed everything this way, your game could really chug...and it could get confusing to have code spread out in unexpected places like this.
if all he wants to do is see smoke when he leaves the room, then why not turn the object on THEN...run the animation...then turn the object off? no need for any global vars, no need for any script being executed 60 times a second for the duration of the game.