- Home /
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?
Answer by MilkX5 · Jan 17, 2014 at 03:44 PM
The problem has stopped. I made a new project and imported the old data. If it happens again I'll comment on this post.
i think the problem is that th epath of your file is wrong, maybe because u move the old data to another folder or u change the directory of your Project that's why it says "cannot find the path specified. "
I encountered the problem again today. But this time I restarted my computer while Unity was still open. It was the force shutdown and now it won't open anything. I can't play the game and I can't make a new project. Any suggestions on how to fix this?
Answer by TheWarper · Feb 27, 2014 at 09:36 PM
Is this your problem?
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
}
}
}
}
Answer by huntsfromshadow · Feb 27, 2014 at 10:31 PM
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.
I have a similar problem on windows. How do you give unity the permissions it needs?
Your answer
Follow this Question
Related Questions
NSIS Error for Unity 4.0.0 0 Answers
Error with scripts compiling Unity4. 5 Answers
BCE0005: Unknown identifier: 'spriteRenderer'. 2 Answers
script not working 2 Answers