How do I destroy only one

Get help using Construct 2

Post » Thu Feb 26, 2015 9:13 pm

Hello,
How do I prevent two objects together that are to be destroyed by the same bullet? (see attached .capx) It looks like a bug. Can anyone help me? Thanks!
You do not have the required permissions to view the files attached to this post.
B
25
S
4
G
2
Posts: 99
Reputation: 2,498

Post » Thu Feb 26, 2015 10:20 pm

The speed of your bullet is way too fast. You need to make it a more sensible speed for collision detection to work properly.
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Thu Feb 26, 2015 10:37 pm

It's obviously the bullet that's moving too fast, so it has the time to collide with two blocks before being destroyed. I tried picking the block nearest to the bullet, or picking the first block that records a collision, but it looks like everything's still going too fast to work out.

The only other way I could think of with my tired brain was to perpetually detect which block is the lowest on the screen and store its Unique ID (UID), and then make sure the bullet can only destroy the lowest block. This method works in your example file, but it might need to be adapted to your real game, and it might also not work at all then.
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
3
Posts: 206
Reputation: 2,379

Post » Thu Feb 26, 2015 11:28 pm

Maybe you can take a look at this, it may be useful (or maybe not, but that's still a good thing to know :D) : how-do-i-handle-per-pixel-detections-and-physics-behavio_p847195?#p847195
B
12
S
7
G
7
Posts: 450
Reputation: 4,276


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 32 guests