How do I destroy only 1 of the same objects

Get help using Construct 2

Post » Sat Oct 25, 2014 10:37 pm

The problem is when the global varible 'Crate Health' = 0 all crates are destroyed instead of only the one my bullet collided with. What I have is:

CrateHealth = 3
When Bullet collides with Crate: Subtract 1 from crate health
When Crate Health = 0: destroy crate

This destroys all the crates instead of only the one that got hit. What I am looking for is a way to destroy just the one without having to create multiple sprites.

Thanks
B
8
S
3
G
2
Posts: 52
Reputation: 1,762

Post » Sat Oct 25, 2014 11:51 pm

Hint: How can you have one variable that tracks health for all individual crates?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Oct 26, 2014 12:03 am

Codah's hinting to the instance variables, you can find them just above the 'behaviours' tab!
B
12
S
1
Posts: 28
Reputation: 978

Post » Sun Oct 26, 2014 2:42 am

thankyou I have never actually used or understood instance variables before. Now I do :)
B
8
S
3
G
2
Posts: 52
Reputation: 1,762


Return to How do I....?

Who is online

Users browsing this forum: DharmaOne, namaewayukidesu and 20 guests