Detect if Mouse or Touch

0 favourites
  • 3 posts
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • I copied the code from the example of Ashley in this forum:

    construct.net/en/forum/construct-3/how-do-i-8/check-mobile-device-and-hide-150846

    On a BLANK/NEW Project it worked perfectly w/ a little tweak from my part.

    But on my CURRENT Project it doesn't. I just copied everything from the forum sample & my new project.

    So here is my intelligent speculation, since my CURRENT project multiple event sheets is already composed of Touch conditions/action, it has now IGNORED keyboard inputs. (I might be 90% wrong on this)

    I could easily recode this to work BUT I really want to understand why it is not working even if they BOTH have the EXACT codes.

    I'm at my wits end on this so if someone can explain/answer this it'll be very much appreciated.

    P.S. Touch "Use mouse input" is ON on all the Projects (sample, NEW, CURRENT). The Sample project has it OFF but then I updated it and still worked fine.

    Tagged:

  • Hard to tell without seeing your actual project, so consider posting your .c3p file.

    From my own tests, modifying Ash's example the way you did, it worked as intended, so perhaps some other events in your event sheets are interfering.

    At last, you could consider using the dedicated triggered actions "Mouse: On object clicked" and "Touch : On touched object" instead of using "Any click + On cursor over object" and "Any touch started + Is touching object"

    This might even fix your issue.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you Kyatric for the reply.

    From my own tests, modifying Ash's example the way you did, it worked as intended, so perhaps some other events in your event sheets are interfering.

    Glad to hear it works as intended but I also tested on my current project creating a new LAYOUT & EVENT SHEET w/o including any of the event sheets (no other event sheet will affect any of the condition/action), but still it fails. Might be something wrong with my project file..

    At last, you could consider using the dedicated triggered actions "Mouse: On object clicked" and "Touch : On touched object" instead of using "Any click + On cursor over object" and "Any touch started + Is touching object"

    Will test this later after my long rest.. Thanks again!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)