How do I delete object on collision

Get help using Construct 2

Post » Fri Jun 23, 2017 1:51 pm

I have a button that creates ball.
This ball fly around the screen, and whenever it hits red box it should be destroyed.
The problem that whenever I try to destroy this object, it destroy all others objects of this kind. In other words, clicking the button creates new object of ball, thus unlimited number can be spawned, however I require to destroy only ones that come into collision with the red box.

Could anyone help me to solve this issue?
B
11
S
3
Posts: 44
Reputation: 713

Post » Fri Jun 23, 2017 2:21 pm

If two objects collide it should only destroy one of this objects not all instances. It depends of your action which object gets destroyed.
The event should look like:

Ball | On collision with Box -> Box| Destory.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Sat Jun 24, 2017 8:21 am

try switching the event around. it likes to be tempermental sometimes.
i.e.
Box - On Collision With Ball- Destroy Ball
may have a different outcome than
Ball - On Collision With Box - Destroy Ball
i believe the logic behind it is: If THIS box comes in contact with any ball, destroy all balls
If THIS Ball Touches any box, Destroy THIS ball.
B
22
S
12
G
1
Posts: 108
Reputation: 2,774


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, jorgmaquoi, kiki4construct and 20 guests