We’ve got a game that’s a good way through and runs just fine from within the Unity editor. However, when I export an OS X Universal Standalone, I get a lot of problems that aren’t actually problems.
Player: init engine
2008-10-02 17:58:15.835 PIT[809:20b] Could not find image named 'ScreenSelector'.
GL: disabling mip map calculation on Render Textures due to memory leak on NVIDIA GeForce 8600 graphics drivers.
Couldn't load the script "JCar" because its file name doesn't match the class name.
Please make sure the file name of the script is the same as the class defined inside it.
(Filename: /Users/unity-build/Desktop/automatic-build-2/unity/Projects/../Runtime/Mono/MonoScript.cpp Line: 382)
Couldn't load the script "Driver" because its file name doesn't match the class name.
Please make sure the file name of the script is the same as the class defined inside it.
(Filename: /Users/unity-build/Desktop/automatic-build-2/unity/Projects/../Runtime/Mono/MonoScript.cpp Line: 382)
Couldn't load the script "PowerupSpawner" because its file name doesn't match the class name.
Please make sure the file name of the script is the same as the class defined inside it.
(Filename: /Users/unity-build/Desktop/automatic-build-2/unity/Projects/../Runtime/Mono/MonoScript.cpp Line: 382)
It goes on and on to list most of the scripts we have in the game, but not all of them. I assure you that the names of the scripts and the files do match (aside from .cs), and once again everything runs just fine in Unity.
Is there any special thing I’m supposed to do to get this to work?
Scripts just need to be placed inside the Assets folder or a sub-folder of it.
I haven’t seen errors like that confined to a stand-alone build.
Based on the error messages alone I would say that you are using MonoBehaviours on your game objects from within script files which names do not match the class names within - however that makes no sense if you can run the game just fine from within the editor.
Just off the top of my head:
Do you perform any special tasks as part of the unity build process?
Are you trying to use MonoBehaviour classes defined within .net assemblies?
Could you make a project available testcasing this same behaviour?
If we’re allowed to have infinite depth in the folders, this obviously isn’t the problem. Some of the scripts it complained about were simply in Assets/Scripts/Subfolder/Foo.cs , basically meaning the “shallowest” script was within 3 folders, and the deepest we have was in 4.
Here’s the build process:
File>Build Settings…
Use our main Unity file, build target OS X Universal, compress textures and don’t strip debug symbols.
Select Build Run
Build happens normally, no problems, app opens.
Select screen resolution etc. and then run.
Initial image shows up, then nothing happens. Console reports errors with scripts.
“Are you trying to use MonoBehaviour classes defined within .net assemblies?”
Not sure what you mean by this, but that probably indicates that no we’re not.
Also, if I try to do this with a different scene it’s unsuccessful.
So its not reproducable then? Sounds like your project is borked somehow. Could you try creating a new project, migrating all the assets to it - except scenes and set up a new scene there - sampling some of the GOs you have in your current scene? Would this reproduce the error when building for stand-alone?
I thought I would report that the solution to the problem was to delete a random .app that was in our assets folder (it was a previous export of the build). If this is what causes the error perhaps it isn’t the best idea to have the default place to export to be inside the project folder.
inside the project folder isn’t a prob
But you wouldn’t want to add it to the asset folder as all asset folder data are built into your app and building an app into an app might be an OS level problem.
The asset folder is strictly for assets (and if you own Pro, Plugins)