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
45
S
12
G
3
Posts: 1,210
Reputation: 7,559

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
31
S
12
G
3
Posts: 75
Reputation: 4,339

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
87
S
22
G
15
Posts: 1,041
Reputation: 15,353


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests