Problems using folders in the path for custom webplayer build

Hello,

I’m using the BuildPipeline.BuildPlayer() function to enable our team to custom build versions of our application.

Although I had no problem with windows standalone saving the build to a path outside the project and with any number of folders in the pathname,
I can not build the webplayer version unless I use a path with no folder names (e.g. locationPathName = “MyBuildName”).
If I try: “Builds” + Path.DirectorySeparatorChar + “MyBuildName”
or
“Builds/MyBuildName”
(with our without a prefix of a DirectorySeparatorChar)
I keep getting an error at the end of the build process saying:
Error building Player: IOException: Failed to Copy File / Directory from ‘C:/Program Files (x86)/Unity/Editor/Data\Resources\WebPlayerTemplates\MyTemplate’ to ‘/Builds/MyBuild’.

Can I not use folder names and use a path outside of the project to build my webplayer?
(I do not want to open a file panel to the user. I’m trying to automate this process).

Thanks!

Anyone?

Unity guys?

Have you tried this with the .unity3d extension on the filename?

I have.

It actually did not work at all when I used the “.unity3d” extension. Although, when building the .exe, I have used the extension and the build was.saved as expected.

unity 3 takes the target path to generate the webplayer folder and the webplayer in, so it might be possible that it expects a trailing “/” in the string provided when doing a webplayer build

Tried to add the trailing separator too but it’s still not working.
I also tried using default or no templates (since I use my own), but no luck there either.

Well, this might be a unity bug.

It seems that I had to create the folder in order for the web build to be saved to the newly created path (I did not need to create the folder when building the windows standalone - the creation was done for me).

So I called System.IO.Directory.CreateDirectory(myDirectory) before building the web version and then I could use the full path and save the new build to it.