Select an object without selecting whats under it

Get help using Construct 2

Post » Mon Aug 20, 2012 6:05 pm

(Solved!) ;D (not a simple solution but I can understand why it is the way it is.)

Hey all,

Im stumped on what seems like a simple interaction and could definately use some assistance.

I just cant seem to figure out how to click on an object without clicking whats behind it as well. Is this even possible?

http://db.tt/8P56nb0x

Here is a link to an example, you will see that Im trying to select my object (blue ball) using the mouse. After selecting it I then want to be able to click somewhere on the field for that ball to head towards.

The problem is when you click the ball you also click through the ball and hit the ground.


Thoughts anyone?GenkiGenga2012-08-20 19:44:21
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Mon Aug 20, 2012 6:24 pm

Just swap the order of the events, so it checks for ground click first before it selects the sprite.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Mon Aug 20, 2012 6:40 pm

Hey @Ramones,

Thanks for the quick response. That is a good idea and something I tried but the problem comes into play again if I want to select a second ball before I issue my move command.

Instead of just selecting the ball as well, it also selects the ground object beneath the ball.

I can make things easier by using right click for movement and left click for selecing but I was just wondering if it was possible to only click on the top object.

(Just wanting to keep it simple and also keep the door open for a touch version in the future.) The only work around I can think of is to have a seperate move button pop up when I select a ball but that kind of makes things clunky.

Any ideas?


Ahh I can select only the ball by inverting a "cursor is over ball" condition in my moving command, problem solved.

Now to find a way to deselect a selected ball by clicking on it again before it moves. Variables should do the job.GenkiGenga2012-08-20 19:15:00
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests