How do I spawn an object equal to my parent enemies hp?

Get help using Construct 2

Post » Mon Apr 14, 2014 2:16 pm

I currently have larger enemies, that I want to spawn smaller "baby" enemies that are equal to the current enemies health. The problem is, this health is constantly changing as it takes damage. And I want the enemies that are spawned at any given moment, to have their hp equal to this.

I can't seem to find any examples of this on the forums, does anyone know of a way to check for this value, when the lesser enemies are spawned? And how to give them that value?
B
4
Posts: 78
Reputation: 606

Post » Mon Apr 14, 2014 2:33 pm

It's time for me to return the favor :)
B
32
S
9
G
8
Posts: 132
Reputation: 4,870

Post » Mon Apr 14, 2014 3:40 pm

@Hexxiss - I assumed you would have local instance variables for health for both larger and baby enemies? If so, then just immediately after creating baby enemy, use action Set Instance Value->baby.health = larger.health.
B
33
S
7
G
8
Posts: 312
Reputation: 8,528


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], ksiads and 2 guests