Bullet collision with only one object

Get help using Construct 2

Post » Sun Feb 16, 2014 12:27 pm

Hi,
I think my problem is very simple but i dont have any idea how to resolve it. The problem is: when my Hero is shooting , bullet hits all enemies which are overlapping. I would like to make that one bullet hits only one enemy.
Have you any ideas how to do this?

Kind Regards
laikkk

ps: here is sample:https://www.dropbox.com/s/r3ps02l8yq5rc4l/sample.capxlaikkk2014-02-16 13:01:02
B
2
Posts: 9
Reputation: 166

Post » Sun Feb 16, 2014 2:34 pm

The collisions are cached, so an easy trick it to add Bullet:'Is visible' to the collision test, and Bullet:'Set invisible' as the first action. The first hit will make the bullet invisible, and the next check will see that it's invisible, so won't count the hit.
ImageImageImage
B
71
S
21
G
220
Posts: 3,646
Reputation: 123,721

Post » Sun Feb 16, 2014 2:37 pm

Isn't it easier to make: destroy bullet when collision with enemy?
B
12
S
4
G
1
Posts: 241
Reputation: 1,699

Post » Sun Feb 16, 2014 3:37 pm

Destroy is already being called, but Destroys are delayed in C2 for just this case, where triggers are called multiple times for each appropriate case.
ImageImageImage
B
71
S
21
G
220
Posts: 3,646
Reputation: 123,721

Post » Sun Feb 16, 2014 4:32 pm

Do you mean this?

It doesn't work ;/. Any another ideas?
B
2
Posts: 9
Reputation: 166

Post » Sun Feb 16, 2014 5:29 pm

I found solution in this topic http://www.scirra.com/forum/collisions-with-multiple-objects-same-spot_topic71607.html
B
2
Posts: 9
Reputation: 166


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, ksiads, Magistross, odiusfly, Yahoo [Bot] and 6 guests