Now this may be a bit complex, as I can't see where is the error in my code. I have a obj_ennemy which is the parent of obj_bad_aim.
obj_bad_aim creation code
// Set health, speed, gun
{
var_health = 2;
speed = 4;
alarm[0] = 30;
direction = 270;
}obj_ennemy collision code (with obj_projectile)
// Damage and destruction
{
var_health -= other.var_damage;
with(other) {instance_destroy()};
if health <=0
{
obj_player.var_combo += 1;
instance_change(obj_stardust,1);
}
}Now obj_projectile is actually the parent of all projectiles. Here's the code of the default bullet, obj_shard.
// Set damage
{
var_damage = 1;
event_inherited();
}This is the creation event, which then leads to the inherited event giving the speed to projectiles.
If you read, you should see through all this that the var_damage of the projectile hurts the ennemy, and the max hp depends on the type of ennemy, and the damage depends on the type of projectile. However, it doesn't work at all. It's not a projectile error, that's for sure. It seems the variable var_health doesn't even exist in-game. I don't get it.











