Error when opening Unity4

Hi. I’ve just installed Unity on my computer and I’ve been working on a project for 3 days. But now every time I run the game, it gives me an error: "Opening file //…/Desktop/Project Name/Temp/tempFile failed: The system cannot find the path specified.

Sometimes I can’t even open Unity and it gives me the same error. I’ve tried pressing Try Again but it gives me the same problem. In the end, it just forces me to shut down Unity. Any help?

The problem has stopped. I made a new project and imported the old data. If it happens again I’ll comment on this post.

Is this your problem?

22817-unityopeningfilefailed.png

It seems that having the project folder shared via Dropbox and switching from mac to pc causes this problem which forces you to click “Try Again” many times before the project can be loaded.

One solution is to automate the “Try Again” click with C# pinvoke code.

(You’ll have to terminate the process manually as the UI stops responding once the “Try Again” search has begun)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);

        public const int BM_CLICK = 0x00F5;

        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);

        const UInt32 WM_CLOSE = 0x0010;

        public Form1()
        {
            InitializeComponent();
        }

        private void btnScan_Click(object sender, EventArgs e)
        {
            IntPtr ButtonHandle = new IntPtr(0);

            while (true) //keep closing until we don't find the button
            {
                System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("Unity");

                foreach (System.Diagnostics.Process p in processes) //should just be one process in this array
                {
                    ButtonHandle = FindWindowEx(p.MainWindowHandle, IntPtr.Zero, null, "Try Again");

                    if (ButtonHandle != IntPtr.Zero)
                    {
                        SendMessage(ButtonHandle, BM_CLICK, IntPtr.Zero, IntPtr.Zero);
                    }
                }

                System.Threading.Thread.Sleep(100);//sleep for 1 second
            }
        }
    }
}

Given the file path it looks like your on Mac, but we’ve seen issues like this on Windows when Unity doesn’t have right to permissions write files in the directory.