Variable Not Changing

0 favourites
  • 5 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I am testing something and am trying to make it so that when a button is clicked, 50 is subtracted from the enemies hp. The enemy's hp could either be 100 or 500, (it is randomized). For some reason, the value refuses to change. When I try with a defined enemy it works fine, however when I try to make the enemy randomized, the value refuses to go down. I have tried using both global and local variables.

    Any help would be greatly appreciated, thanks in advance! ;)

    Tagged:

  • Also, in case it helps, whenever I try using the randomized approach, (the one which I have the issue with), the enemies health bar appears to flicker as if it is being subtracted for a split second then reset.

  • Hi, there is probably an event interfering with the HP substract one, can you post a screen of your code or share a capx please?

  • Hi, there is probably an event interfering with the HP substract one, can you post a screen of your code or share a capx please?

    Dont worry man, I realized what it was - I had left an event that kept resetting it lol. Thanks for the help anyways!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ah you found it, perfect :)

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