How do I differentiate between drag and click?

0 favourites
  • 3 posts
From the Asset Store
Use inertion of your movements to throw, rotate your objects and etc. Objects can interact with others while dragging.g
  • Hello there, tnx for your atention

    I have an object with Drag&Drop behavior, when I begin to Drag him it makes a sound, and when I Drop him it makes another sound;

    When I double-click him he rotates and make a third sound;

    Problem is, when I double-click the object c2 thinks I am starting to drag him, and the sounds get in the way and go together.

    How do I differentiate between drag and double-click the object, so I can double-click him without c2 thinks that I am draging?

    Tiny little problem that I can't figure out

    Thank you in advance

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would suggest starting a timer when the event On Drag & Drop start triggers, with a short duration of your preference. (Call it 'delay' if you want)

    Only trigger the Drag sound when the timer finishes.

    Stop the timer when a double-click has been triggered.

    This will avoid triggering the drag & drop event when there was a double-click X seconds after the On Drag & Drop start event has been triggered. (replace X by your delay)

    Might sound confusing, here is an example .capx that I made for you.

    Hope this helps.

  • randomly you got it! Very clever approach, did help xD

    Thank you very much, be blessed /\</p>

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