Touch reacts differently on PC and touch device

Discussion and feedback on Construct 2

Post » Sun Oct 16, 2016 1:28 am

Hi,
In the enclosed .capx, everything works perfectly well on PC (draw path, click red dot to make it follow path) but it fails to work on touch device. But the code is the same
Is there any explanation to that ?
https://www.dropbox.com/s/cy7meg88k77ea ... .capx?dl=0

Thanks for your help
B
38
S
16
G
5
Posts: 270
Reputation: 5,971

Post » Sun Oct 16, 2016 7:58 am

It seems like it on registers the on touched trigger while playing it on a phone and ignores the Is in touch event.

Edit:
Nope, the problem was that you used Mouse.X and Mouse.Y in your expression. And since touch devices like phones don't have mouses it couldn't get it's coordinates. Replacing those with Touch.X and Touch.Y solves the problem. Here's a fixed version: https://dl.dropboxusercontent.com/u/166 ... wPath.capx
B
138
S
33
G
17
Posts: 1,561
Reputation: 20,839

Post » Sun Oct 16, 2016 8:23 am

glerikud wrote:It seems like it on registers the on touched trigger while playing it on a phone and ignores the Is in touch event.

Edit:
Nope, the problem was that you used Mouse.X and Mouse.Y in your expression. And since touch devices like phones don't have mouses it couldn't get it's coordinates. Replacing those with Touch.X and Touch.Y solves the problem. Here's a fixed version: https://dl.dropboxusercontent.com/u/166 ... wPath.capx



@glerikud
Thanks you so much !! ou're the best ! I was so obsessed by the touch action that I completly forgot to check the rest of the code.
B
38
S
16
G
5
Posts: 270
Reputation: 5,971

Post » Sun Oct 16, 2016 10:11 am

Laurent wrote:@glerikud
Thanks you so much !! ou're the best ! I was so obsessed by the touch action that I completly forgot to check the rest of the code.

You're welcome. Happy developing. :)
B
138
S
33
G
17
Posts: 1,561
Reputation: 20,839


Return to Construct 2 General

Who is online

Users browsing this forum: thesmileisles and 29 guests