collision problem

Get help using Construct 2

Post » Tue Sep 10, 2013 12:49 am

hey folks ive got a small problem which i cant work out how to sort it when i have my zombies attack sometimes they overlap but when they do and a bullet hits them it normally kills all of them which messes up the counter i only want one to take the hit please help

http://www.filedropper.com/zombieshootemup_1

Thank you for any help
B
19
S
6
Posts: 143
Reputation: 1,835

Post » Tue Sep 10, 2013 3:47 am

Objects aren't destroyed right away. With that in mind, there are several ways you could fix this. The first that came to my mind was doing this:

B
10
S
4
G
1
Posts: 58
Reputation: 1,420

Post » Tue Sep 10, 2013 3:54 am

Actually, a better solution for your problem would probably just turn off collisions instead of setting it invisible and checking invisible.
B
10
S
4
G
1
Posts: 58
Reputation: 1,420

Post » Tue Sep 10, 2013 1:03 pm

sorry you lost me what you mean by turn off collisions? how would the bullet hit the zombie and determine which zombie to hit?
B
19
S
6
Posts: 143
Reputation: 1,835

Post » Thu Sep 12, 2013 3:00 pm

sorry you lost me what you mean by turn off collisions? how would the bullet hit the zombie and determine which zombie to hit?
B
19
S
6
Posts: 143
Reputation: 1,835

Post » Thu Sep 12, 2013 4:37 pm

Once the bullet hits a zombie, turn off collisions for that bullet. In the example above I made the bullet invisible, and checked for visibility before the collision event would trigger. I think a better solution would be this:
B
10
S
4
G
1
Posts: 58
Reputation: 1,420

Post » Fri Sep 13, 2013 2:06 am

ah i get it and this should stop more then 1 zombie being destroyed from same bullet?
B
19
S
6
Posts: 143
Reputation: 1,835


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 37 guests