I am having issues with clicks & taps

Hello, I am playing around with Defold and trying to understand how it works, so I can build a game I planned. But I am having a issue with clicks .

Here is a summary, I use the factory to populate the screen with a 10 emojis at random positions . But for some very weird reasons, some emojis don’t respond to clicks except I click or tap multiple times, and its really frustrating .

I have tested multiple renderers and cameras and got the same issue .

I would like to mention that I am making use of the code from the click demo and example by @britzl to detect clicks on an object, via the collision object setup.

I don’t know if I gave enough details, if you need more details to help me, kindly let me know . Thanks.

Since you are using a camera my guess is that you might not be positioning your cursor object correctly. Are you taking the camera translation into account, ie doing some kind of screen to world position conversion from mouse/touch position to in game world coordinates? Camera solutions such as RenderCam and Orthographic both provide this.


Thanks for your response.
I ran some tests , the issue was that some of the emojis where overlapping , and they are quite small 72px , so I guess this was “confusing” the cursor collision detection .
So I ensured there was no overlap, or no emoji “share x and y coordinates”
I would test more to see if the issue comes up again

1 Like