Ok so I’m having an issue I can’t find another report of. Every other Moving file failed either refer to other feature or to the csharp dll thingy. That’s not my case !
So first of all when does it happen ? When I force close, Unity reports it happens on CreateAsset() (AssetDatabase method), and indeed looking at the file names, the destination file is the one I try to create ! Problem is, it worked only a day ago. All I changed is the function that calls it (I had a bunch of code together, unorganized, so I reorganized it with functions and a couple of static classes for later uses).
Now the message I get :
I really don’t understand. I checked for files being read-only, tried to run Unity as administrator, disable the antivirus, ALL at the same time, to no avail…
Thanks in advance !
So in case anyone gets the same kind of error this is probably the same very dumb mistake as I did. While reformatting the process to separate into useful functions I had a couple of helper functions (mostly to assemble paths and asset names, and avoiding saving out of “Assets” folder) and I forgot in ONE of the function, to add the asset name at the end. So what I was trying to do was pretty much saving a folder as a file… Like this :
AssetDatabase.CreateAsset(asset, "Assets/Path/")
I’d like Unity to be cleare about it, but my guess is that it tries to create the file “Path/” which is impossible as Windows doesn’t accept special characters for folders. Where can I add this as a bug ? I think Unity should check for trailing special characters or at least give a different message if it couldn’t create the file (because not being able to and not being authorized by the OS to is not the same)