Drag works every second time

I have this weird behavior when following this tutorial:

Before unchecking “Use Mouse for Touch” the drag worked every second time: on first drag you don’t see cursor picking up the widget, on second drag you do. In each cases debugging shows that OnDragDetected gets fired and “Create DragDropOperation” gets executed.

The blueprint of OnDragDetected part is attached. OnMouseButtonDown handled as in tutorial. No OnDrop handling.

Hello ,

This set up appears to work just fine on my end. It drags every time without any issues.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide any steps that may have been left out of your original post?
  3. Could you check to make sure that there are no other blueprints consuming input?
  4. Could you provide a screen shot of the the rest of the blueprints that are being used?

Hi Rudy,

Yes, I just reproduced it on a clean project (Blueprint-Empty). One thing I didn’t mention that I’m on Mac.

There doesn’t seem to be anything special in the steps, just the things to make a project work. Here’s what I did step-by-step (hope I memorized it all):

  1. created HUD widget, Item widget, MainGameMode and MainPlayerController blueprints;
  2. selected MainGameMode in project settings to be default, referred MainPlayerController there.
  3. in MainPlayerController said to “Show Mouse Cursor”.
  4. GameMode blueprint BeginPlay creates HUD instance and adds it to viewport;
  5. Item is [Size Box]-[Border]-[Text] hierarchy. Set some size, color and text there.
  6. Overrode OnMouseButtonDown for Item (with Detect Drag if Pressed as in tutorial for Left Mouse Button);
  7. Overrode OnDragDetected for Item as on attached screenshot;
  8. Dragged a few Item widgets to HUD canvas panel;
  9. Ran in New Editor Window, using iPad 2 Portrait screen size.

With these steps the item picks up drag every second time. Going to Project Settings and unchecking Use Mouse for Touch makes it work properly.

Hope this helps. I can send you this test project if it doesn’t.

Hello ,

I tested the steps provided and was unable to reproduce this issue on our end. I tested it both on a PC as well as a Mac but was still unable to see the effect that you are describing. I think that sending your project would be the next step so that I can take a closer look.

Hello ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

Yes, as I was commenting I reproduced the issue on an empty project. If you think that unchecking “Use Mouse for Touch” is a convenient workaround then I go with it.

Hello ,

I gave this one more try and was able to reproduce this issue on our end. I have written up a report ( UE-17581) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. I do believe that the workaround you have mentioned is a good one. Thank you for your time and information.

Make it a great day

Also, never use the widget detecting the drag, as the default drag visual. A widget can’t be in two places. You should always create a new widget as the default drag visual.

I am running into the exact same issue. The problem is that I can’t use the work around because I am developing for mobile and I NEED the mouse to mimic touch commands. Has there been any progress on this bug?

Hello ,

I went ahead and double checked on this issue for you. I found that the status of this issue has not been changed to fixed as of yet. However, I will be sure to bump up the community interest for this issue. Thank you for your time and information.

Make it a great day