How do I reset only one global variable?

0 favourites
  • 6 posts
From the Asset Store
Globals 2.0
$3.60 USD
10% off
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • hi, i need reset one or two global variables, for example, if the time is 0 the global variable "life and time" reset

  • Swivels

    One way is to create a couple of extra globals e.g. lifeInit and timeInit, and set them to the reset values.

    When you want to reset "life" and "time" set them to lifeInit and timeInit.

  • i understand you, but i forgot that life have 6 global variables (7 in total), for each monster life put the value of the life on te monster on the screen and time only have one (seconds), so i need that when the time be 0 and the moinster have life, only this life reset, because when i destroyed the monster system add 15 seconds more to another monster on screen (in global variable time), if i set the value of "monster1" (example) the monster never lose life.

  • Why do you keep the monster life as a global variable? Never less you can add event that will check if time is 0, then reset all those life variables to what ever value you like.

    event system -> compare global variable -> time <= 0

    action system -> set global variable -> health1 = 10

    action system -> set global variable -> health2 = 10


  • I have the solution, thanks friends

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • can you give me the solution?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)