Hi,
I'm making a game where I've created a family called "enemies", and have it set up so whenever the bullet hits the enemy they lose health. However, my enemies are supposed to have different amounts of health. How do I say subtract health from "enemies", but have it affect different instance variables?
Thanks,
William
Develop games in your browser. Powerful, performant & highly capable.
Hi WilliamAnderson, if I understood, the collision trigger already pick bouth instances (bullet and enemy), you just need to put Enemies (familly) health subtract 1 as a action of the trigger (condition). It´ll take out 1 from the enemy that collided with the bullet.
The variable health must be in the family, not the instance.
But what if enemies have two different health totals? I cannot have one family health variable representing both.
WIlliam
You have a family of enemies.
You can set any variable that you want in it.
healthAB
healthCD
When collide, you say wich variable you´ll subtract.