I want each object to track its own health

Get help using Construct 2

Post » Wed Mar 19, 2014 4:37 pm

I'm spawning multiple instances of the same enemy on screen at one. when the player "destroys" one, its destroying all instances regardless of when I put on extra conditionals to make it specific to that one. Right now I'm just making it so the one that is withing a certain range ( >100px away) is attackable, however one attack still destroys all instances
B
2
Posts: 4
Reputation: 158

Post » Wed Mar 19, 2014 5:36 pm

You need to add the Pick event to set which one you want to destroy.
Try posting a capx, so it makes it easier for us to help you out.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Wed Mar 19, 2014 5:37 pm

Not being able to see your code, I am almost 100% certain that there are something wrong with your picking, when you destroy enemies. Either double check it, or post a screenshot and I think a lot of people in here can tell you where it goes wrong.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Mon Mar 31, 2014 7:17 pm

I had the same problem but I fixed it with UID and Pick event.
Try the Selection by UID and check the range, it should work
B
26
S
10
G
3
Posts: 72
Reputation: 4,008

Post » Mon Mar 31, 2014 8:13 pm

Are you using the system condition "Compare two values"? Because that won't pick objects. You want to use the object's "Compare instance variable"
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249


Return to How do I....?

Who is online

Users browsing this forum: max2612 and 11 guests