# How do I Collision with multiple objects

Get help using Construct 2

### » Tue Jun 13, 2017 9:43 pm

1 - I'm doing a fighting game between two base
2 - Both sides create units to fight each other.
3 - The problem is when the units meet
Instead of just attacking a single enemy unit, it ends up dealing damage to several other units that are together.
How do I attack him one at a time?
.CAPX
https://mega.nz/#!5bg10TBZ!QOleGSxRMazB ... fazKbswUio
Translate PT/BR
B
23
S
2
Posts: 47
Reputation: 1,005

### » Wed Jun 14, 2017 4:24 am

I had this problem also until I learned that you can add an EXTRA condition using OBJECT that is colliding to PICK INSTANCES using the Z ORDER where you can say for example pick the top one when many collide.

So:
1) OBJECT #1 collides with OBJECT #2
and 1 more condition: OBJECT #2 Z ORDER pick top/bottom > top

Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
11
G
1
Posts: 97
Reputation: 2,479

### » Wed Jun 14, 2017 2:19 pm

DolyGamesCosmos wrote:I had this problem also until I learned that you can add an EXTRA condition using OBJECT that is colliding to PICK INSTANCES using the Z ORDER where you can say for example pick the top one when many collide.

So:
1) OBJECT #1 collides with OBJECT #2
and 1 more condition: OBJECT #2 Z ORDER pick top/bottom > top

Perfect!!! Saved my project
Thank you very much =D
B
23
S
2
Posts: 47
Reputation: 1,005

### » Wed Jun 14, 2017 6:10 pm

DolyGamesCosmos wrote:I had this problem also until I learned that you can add an EXTRA condition using OBJECT that is colliding to PICK INSTANCES using the Z ORDER where you can say for example pick the top one when many collide.

So:
1) OBJECT #1 collides with OBJECT #2
and 1 more condition: OBJECT #2 Z ORDER pick top/bottom > top

Perfect!!! Saved my project
Thank you very much =D

My pleasure
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
11
G
1
Posts: 97
Reputation: 2,479