4

I was working on a Unity 2D game project on OS X 10.10, and I can't drag file or folder, it will show this error.

No Drag&Drop has been setup. Please
UnityEditor.DockArea:OnGUI()

I have tried:

  1. save project and then restart
  2. click Assets folder and choose Reimport All

But it seems not work, how to fix it?

user3071284
  • 6,955
  • 6
  • 43
  • 57
rj487
  • 4,476
  • 6
  • 47
  • 88
  • Are you referring to moving files/folders in the Project tab under Assets? – user3071284 Sep 04 '15 at 17:48
  • Looks like a Unity bug, have you tried another/newer Unity Version or Patch Release? – JeanLuc Sep 04 '15 at 19:39
  • I am referring every action using drag, like move project folder to another folder, move project object to scene. I think I should upgrade to latest version. – rj487 Sep 05 '15 at 03:15

6 Answers6

10

Recently I have the same problem and what I did was quit Unity and force quit the pboard process via Activity Monitor and then launch Unity again, it works for me.

Sinyo
  • 101
  • 1
  • 4
  • 1
    I did exactly what you said and it worked. Thanks alot – mnaa Apr 20 '16 at 23:03
  • 1
    Worked for me, too. In case anyone was wondering about the **why**, check [this more-in-depth explanation](http://krypted.com/mac-os-x/the-cut-copy-paste-daemon-in-os-x/). :) – Domi Jun 02 '16 at 02:53
  • Thanks a lot. Save me from this weird problem. – sakiM Jun 11 '18 at 07:48
4

Unity uses NSPasteboard (OSX shared manager for clipboard) to hold the data for Drag&Drop, so any process that monitors/modifies the clipboard may be messing with the Drag&Drop.

I think there might be a Chrome extension that would be generating notifications that would for some reason break drag and drop. Disable all your extensions in google chrome and if that doesn't solve your problem in Unity then do a fresh install of google chrome.

Edit: As suggested by other users, another solution that might work is

Quit Unity and force quit the pboard process via Activity Monitor and then launch Unity again.

Hope it helps.

mohakagr
  • 1,104
  • 11
  • 26
1

Based on the answer provided by Sinyo I created a small shell script to speed up the process and thought I would share. [For Mac only] It closes Unity, kills the pboard process, then reopens Unity.

#!/bin/sh

osascript -e 'quit app "Unity"'

pid=$(ps -fe | grep 'pboard' | grep -v grep | awk '{print $2}')
if [[ -n $pid ]]; then
    kill $pid
else
    echo "Does not exist"
fi
osascript -e 'launch the application "Unity"'
Community
  • 1
  • 1
user3130047
  • 11
  • 1
  • 1
  • 2
0

I know this is an old thread but I thought I might contribute. I was having the "No Drag&Drop" error in an implementation of a property drawer and tried all the tips given here with no success. I was about to give up and blame it on unity, but then I found a solution. You see, I was setting the object references and calling the DragAndDrop.SetGenericData() method during the mouseDown event. I changed it so that in the MouseDrag event I check to see if there is existing DragAndDrop (checking for null in the return of DragAndDrop.GetGenericData()). If its null, I set the data during on MouseDrag just before calling DragAndDrop.StartDrag(). This fixed the problem. Hope it helps someone else.

cosmoonot
  • 2,161
  • 3
  • 32
  • 38
0

Based on @user3130047's answer, this is another version. Mac Only.

  1. Quit Unity.
  2. In console, put this command and execute it.

    ps aux | grep pboard | grep -v grep | awk '{print $2}' | xargs kill -9 | launchctl start com.apple.pboard
  3. Open Unity.


That's it.

But, this may cause your another opened applications copy&paste doesn't work. So, you need to restart them.

Jinbom Heo
  • 7,248
  • 14
  • 52
  • 59
0

This is the simplest way to accomplish the best answer:

killall -HUP pboard

(from terminal or similar, obviously)

Bradley
  • 91
  • 1
  • 3