Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: nicosio on December 04, 2011, 10:32:49 PM

Title: Problem with variables
Post by: nicosio on December 04, 2011, 10:32:49 PM
Hello!, I am new to playMaker and I have a small problem with global variables. How can I reset all the global variables to some default value when the game runs? When I click the play button at unity the values of the variables change correctly, then I stop the game and if I click the play button again the game start with the last calculated values of the last run. I want that each time I click the play button the values reset to 0.

Thanks :)
Title: Re: Problem with variables
Post by: jeanfabre on December 05, 2011, 12:20:46 AM
Hi,

 wooo, never realized it was doing this! tested, and yes, global vars persists.

As a direct measure, create a fsm somewhere, and set the value to 0 using "set int value" action. That will do.


Bye,

 Jean
Title: Re: Problem with variables
Post by: Alex Chouls on December 10, 2011, 11:47:14 PM
This is fixed in the next update. In the meantime you need to initialize global vars as Jean suggests.