Search Unity

Drag and drop problems in editor

Discussion in 'Editor & General Support' started by nicmarxp, Jul 13, 2020.

  1. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    I have problems dragging and dropping things in the editor, mainly from the project view to hierarchy or when i'm assigning something to the inspector.

    I believe it has to do with how fast I do it, but I have no problems in other applications.
    Check the video below, where the mouse clicks are indicated.

    I believe the process is like this:
    1) Click and hold an item in Project view
    2) Drag it to the Hierarchy
    3) Release

    Sometimes it works if I wait on step 2 until I see the green plus icon. Also sometimes it works better if I first click the item in Project view, then click and hold.

    I'm using Unity 2019.3.11.f1 on a 2018 Macbook Pro, 2,9 GHz Intel Core i9, 32 GB RAM on Mac OS Mojabe.

    On a side note, is there no easier way to create prefabs out of 209 sprites, than to drag them into the scene, and then drag them back to create the prefab? :)

    Thanks!

     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    This probably isn't the cause, but have you tried using a different mouse, in case you have an extra one sitting around? I've had several experiences where a mouse started going bad, and would "release" the help button prematurely. It's maybe an easy thing to test quickly.

    Otherwise, maybe try profiling the editor while you're doing this drag and drop operation? It's possible it will show a big performance spike that might help explain the behavior.
     
  3. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    I tried with the trackpad and it's the same thing, it seems like the editor is doing something that lags when I just start dragging, if I wait after starting the drag, it works, but the dragged gameobject text is updating pretty slowly.

    I'm not good at reading the profiler, but this is how it looks. Does it make any sense? :)

    In a blank process it almost always works, but there is still some kind of lag when starting to drag. So is my project too complex? :/

     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    It's hard for me to tell, from that, what's causing the issue. I'd probably try the following:
    • Create a new project and see if it has the same issue. That way you can determine if it's specific to your main project.
    • Reset your Layout. Windows -> Layouts -> Restore Factory Settings. I don't know if that will matter, but it's possible.
    • Make sure your project is backed up, so you can easily revert the changes you're about to make. Then, start deleting scripts in your project until you (hopefully) pinpoint the script that's causing this to happen. I'd start with any 3rd party Editor scripts you might have in your project.
     
  5. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    Thanks, I tried in a new project, and the drag always works, but there is still some kind of lag when starting to drag.
    But removing editor scripts one by one could be an idea, it can be quite painful though, when starting to delete stuff, lots of stuff will break, and it might not even work properly.. but thanks for the idea :)

    Reset layouts usually helps weird bugs, so I'll try that. Thanks again :)
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    Yeah, that's why hopefully you can just revert away the destructive changes, assuming you're using version control. Usually I find it's pretty harmless to delete Editor scripts, since very few things depend on them, so you're not likely to get compilation errors. Do keep in mind that if you have any compilation errors while deleting stuff, that would invalidate this test, since Unity won't actually reload the domain if there are compilation errors.

    Another thing, in the small project, would be to just create ~1000 things in a directory. You could do this by just copy/pasting some prefab1000 times in Windows Explorer, just to see if dragging stuff out of that folder into your scene runs into issues when there are a lot of files in one directory.
     
  7. t-ley

    t-ley

    Joined:
    Mar 6, 2017
    Posts:
    77
    I have the same problem it’s not the mouse when the prefab isn’t loaded or say even dragging into the hierarchy is a mess if the prefab is grabbed to fast and slow to load a clicked prefab maybe trying to work to fast

    no I just had to hold the button down till the drag arrow went sideways I was letting go of the button too fast works fine now thanks when I let go to fast it would like try to drop it on the desktop right through the engine
     
    Last edited: Nov 26, 2022