playMaker

Author Topic: Problem with variables  (Read 2670 times)

nicosio

  • Playmaker Newbie
  • *
  • Posts: 8
Problem with variables
« 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 :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Problem with variables
« Reply #1 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

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Problem with variables
« Reply #2 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.