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?

3
  • Are you referring to moving files/folders in the Project tab under Assets? Sep 4, 2015 at 17:48
  • Looks like a Unity bug, have you tried another/newer Unity Version or Patch Release?
    – JeanLuc
    Sep 4, 2015 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 5, 2015 at 3:15

6 Answers 6

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.

3
  • 1
    I did exactly what you said and it worked. Thanks alot
    – mnaa
    Apr 20, 2016 at 23:03
  • 1
    Worked for me, too. In case anyone was wondering about the why, check this more-in-depth explanation. :)
    – Domi
    Jun 2, 2016 at 2:53
  • Thanks a lot. Save me from this weird problem.
    – sakiM
    Jun 11, 2018 at 7: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.

3
  • I tried this solution, I delete Chrome and restart Unity, but it didn't work.
    – rj487
    Sep 5, 2015 at 14:30
  • I restart macbook and disable chrome extension push bullet, and it work. Thanks!
    – rj487
    Sep 5, 2015 at 16:25
  • Ignore this answer and read Sinyo's answer below (or hopefully will be above someday)
    – pertz
    Jul 4, 2017 at 14:29
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"'
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.

0

This is the simplest way to accomplish the best answer:

killall -HUP pboard

(from terminal or similar, obviously)

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.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.