Health system for non-player characters

Hi, im new to Gdevelop. I need a way to create health system for players in game. Here is the basic idea:

-Every enemy object created is created with an attached health variable.
-Every time a bullet is created it is created with a damage variable indicating amount of damage it can do. Different bullets have different damage.
-Every time a bullet hits the object, health is declined by the amount of damage of that particular type of bullet.
-When health reaches zero, player is destroyed.

How do I get this done in Gdevelop?

I have formerly used stencyl game engine, and have done this fairly easily on it and im sure it would be as simple as it was there, just need to figure out right places to look.

Thanks in advance :slight_smile:

Right click on an object you want to add the variable to.

Go on “other properties”.

Where it says “object variables”.

Left click on “Variables” just below that. Here you can see all the variables an object has.

You can use the + symbol in the top corner to add a variable. You will be prompted for a name and a default value. You can always go back and change this later on.