How to select specific object which is overlapping

Get help using Construct 2

Post » Sat Mar 30, 2013 10:18 am

Let's say that I am creating 2 different bullet objects, each with different random interval.

I set the event:
- On object left-btn click and left-btn is down = set Bullet Disabled
- On left-btn released = set Bullet enabled

Problem is, when those 2 objects overlap by coincidence, I can't just select the top object, it will always causes both objects to have their Bullet property disabled.

Question is - how to select specific overlapping object?
B
3
Posts: 6
Reputation: 437

Post » Sat Mar 30, 2013 10:35 am

I think the answer to your question lies in choosing the "Pick nth instance" condition.
B
14
S
3
G
3
Posts: 89
Reputation: 2,750

Post » Sat Mar 30, 2013 10:42 am

[QUOTE=Telyko] I think the answer to your question lies in choosing the "Pick nth instance" condition.[/QUOTE]
I don't get how to use that condition though, can perhaps give me an example?
B
3
Posts: 6
Reputation: 437

Post » Sat Mar 30, 2013 11:19 am

I'm sorry, I'm no expert enough to know how to use it in your case, I just know (I'm pretty sure) it's the one involved.
B
14
S
3
G
3
Posts: 89
Reputation: 2,750

Post » Sun Mar 31, 2013 5:44 am

Still unresolved, any expert can help me here?
B
3
Posts: 6
Reputation: 437

Post » Sun Mar 31, 2013 6:03 am

In this case you don't want to use "Pick nth instance" because you don't know the index of the object you want to pick. Instead, you should use the object's "Pick top/bottom" condition. When multiple objects have been picked by an event, this allows you to pick only the top-most/bottom-most object. Here's an example:

Z order picking

Hope that helps.linkman20042013-03-31 06:04:26
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Mar 31, 2013 7:13 am

[QUOTE=linkman2004] In this case you don't want to use "Pick nth instance" because you don't know the index of the object you want to pick. Instead, you should use the object's "Pick top/bottom" condition. When multiple objects have been picked by an event, this allows you to pick only the top-most/bottom-most object. Here's an example:

https://dl.dropbox.com/u/917406/zOrderPicking.capx

Hope that helps.[/QUOTE]
Wow... Never would expect it was that simple to do... Never realized there was a 'Pick top/bottom-most object' function.

Now my issue is resolved, thanks!
B
3
Posts: 6
Reputation: 437


Return to How do I....?

Who is online

Users browsing this forum: Matthew de, onzephyr and 0 guests