Drag Drop Activate bug (?)

This forum is currently in read-only mode.
From the Asset Store
Use inertion of your movements to throw, rotate your objects and etc. Objects can interact with others while dragging.g
  • So I have a bunch of units (sprites) in a board-game type of setup. There are two phases. In one phase, I click on the units and give them orders. In another phase I enable drag and drop behavior (deactivated in phase 1) to issue moves.

    The problem is, when I activate the drag and drop behavior, the units I clicked previously seem to enter "Being dragged" phase even though I use a Button to change between phases, and even though my mouse button is not, in fact, being held down. I can attach a cap but it's pretty confusing, so if any ideas come ot mind quickly let me know. Thanks

  • Confirmed, there's a bug with deactivate.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Another drag and drop issue (which may not be a bug)

    I have this code:

    On Click Object1 --> Enable Group 1
    ===Group 1=== (Deactivate by default)
    Is Var1 Equal to 1
      +[Invert] Left mouse button is down  --> Set Var 1 = 0
    Is Var 1 Equal to 0
      +On Drop Object1 -->  Do stuff[/code:3dztzwo3]
    It appears that the first click on Object1 (the one that activates group 1) once in a while triggers the On Drop condition.  It seems like it shouldn't since the left mouse button has to not be down before we get to that subevent.  And yet, once in a while it seems to do it.  Any ideas why?
  • And if I replace the Invert Left Mouse button is down with On Left mouse button released, then the first click always triggers the On Drop condition. If i add a delay of 150 ms prior to setting Var 1 to 0, then it seems to work, though it is possible that the delay just makes the occurance more rare. Any idea what's going on? Seems like maybe there's a timing issue with the mouse / keyboard object perhaps? Or maybe I'm doing something wrong.

  • Huh, it's getting weirder now. I also have an Is Dragging condition under the Is Var1 Equal to 0, but that does not activate, only the On Drop does. Now I'm really confused since if one is activating so should the other (they're under the same conditions, and you need to be dragging before you drop).

  • Triggers are "triggered" when they occur regardless of their position in the event sheet. That may be what's going on. I don't know if you were able to find a workaround but here is one that may be of use. The box is selected on the first attempted drag then it can be dragged with any following drags.


    made in cc1.2

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