Create Object with Touch.X Touch.Y not working

Get help using Construct 2

Post » Mon Dec 12, 2016 1:48 pm

When I use:
Mouse - On left button clicked - Create Object on layer 0 (Mouse.X, Mouse.Y)

It works perfectly and the object is created at the point where I click


When I use the same logic for touchscreen

Touch - On Tap Gesture - Create Object on layer 0 (Touch.X, Touch.Y)

It creates the object at (0,0) anywhere I tap

I also tried other touch functions as for example as "Is in touch"

But nothing working. Anybody a suggestion how I can get this working so that at the location (X,Y) where I tap the object is created?
B
6
S
1
Posts: 10
Reputation: 420

Post » Mon Dec 12, 2016 2:23 pm

Image

Does that work? (change the created object and the layer to the correct ones in your game)

On tap should also work if you set it up the same way
Last edited by Anonnymitet on Mon Dec 12, 2016 2:29 pm, edited 2 times in total.
B
55
S
24
G
13
Posts: 767
Reputation: 12,575

Post » Mon Dec 12, 2016 2:24 pm

On tap is triggered when you touch and release - after release, there are no coordinates. Just store the touch coordinates "On any touch start" or "Is in touch" and use them "On tap".
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 46 guests