How do I stop tap gesture touching through layers

Get help using Construct 2

Post » Thu Jan 15, 2015 11:20 pm

In my game I have a layer called "objects" and in front of it a layer called "front". Randomly there are objects "peeking" up on the "objects" layer and then they slide down again. While testing I discovered that the hidden objects can be tapped through the covering objects on the "front" layer. How do I get rid of this?

Any help would be greatly appreciated!

Thanks
B
32
S
10
G
6
Posts: 259
Reputation: 6,776

Post » Fri Jan 16, 2015 12:11 am

Use Is Layer X visible (or invisible)
Image
B
16
S
7
Posts: 126
Reputation: 1,910

Post » Fri Jan 16, 2015 12:19 am

EstudioCelula3 wrote:Use Is Layer X visible (or invisible)

Already tried that, didn´t work :(
I think the problem is the collision box that travels up and down with the object. I want the object to be touchable all the way down until he is hidden behind the front layer.
B
32
S
10
G
6
Posts: 259
Reputation: 6,776

Post » Fri Jan 16, 2015 5:32 am

Sounds like some sort of comparison is called for. For example only allow the click when the object is under specific y coordinate (if the peeking happens upwards).
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Jan 16, 2015 7:41 am

Somebody wrote:Sounds like some sort of comparison is called for. For example only allow the click when the object is under specific y coordinate (if the peeking happens upwards).


Yes that seems tobe working :) Thank you! :)
B
32
S
10
G
6
Posts: 259
Reputation: 6,776

Post » Fri Jan 16, 2015 7:52 am

Glad to help.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Buddhika, R0J0hound and 14 guests