- Home /
GameObjects missing when using Build & Run
Hello,
I am experiencing some weird behavior when using Build & Run to compile and play my game. I have 3 scenes... a menu scene, a character creation scene, and a game scene. The menu screen just has 2 buttons, the character creation scene has A character model that was imported from blender. The game scene has the same character model with more scripts on it to move him around etc...
Now when I "Play" the game in the editor I can transfer between the scenes just fine, everything works as planned. However, when I Build & Run the game, when I transfer from the menu scene to the character creation scene the character model does not show up in the scene. Then when I transfer to the Game scene the character model still isn't there. however objects that are parented to him still appear in the parented location(so it seems like all the character models transforms are present, however the animations dont play.. because well the model isnt there...) and the movement / input control scripts. seem to still work...
Now an interesting thing is if I Build & Run only 1 scene (either the character creation or the game scene) then the model shows up and everything works fine. If I build more than 1 scene the problem occurs.
In addition, there are 0 Game Objects being transferred between scenes. The only function being called is Application.LoadLevel("Scene Name"). And once again when I play it in the editor everything shows up and works correctly... but Building and running more than 1 scene causes the Character Model to disappear.
I was hoping someone could enlighten me as to some of the differences between running in the editor and the Build and run to maybe identify why this is happening... Or if anyone has any thoughts.
Furthermore, I didnt use to have this problem, and it appeared to start happening after I added a new set of textures and imported a new font to the project... I dont see why that
would make a difference but just thought I would mention it.
Any theories would be great
Thanks
Try checking your editor log for errors, especially after compiling and/or building the project.
You might also try making a development build with script debugging, and checking the log output from that.
If you don't have any specific error messages to investigate, it seems like we'll have a very hard time helping you.
Indeed, was hoping someone had experienced something like this before and had a solution at hand. Nevertheless here is the output from the Script Debugging dev build log:
Unloading 4 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
Unloading 2 unused Assets to reduce memory usage. Loaded Objects now: 614. Operation took 12.482117 ms. System memory in use: 104.2 $$anonymous$$B. Invalid SceneHandle
(Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Camera/UnityScene.cpp Line: 283)
Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
Unloading 16 unused Assets to reduce memory usage. Loaded Objects now: 559. Operation took 4.348425 ms. System memory in use: 113.2 $$anonymous$$B. Data sucessfully loaded UnityEngine.Debug:Internal_Log(Int32, String, Object) UnityEngine.Debug:Log(Object) CharDataBehavior:loadData() (at C:\Users\owner\Desktop\In Exilium\Assets\Scripts\Behaviors\CharDataBehavior.cs:36) CharDataBehavior:Start() (at C:\Users\owner\Desktop\In Exilium\Assets\Scripts\Behaviors\CharDataBehavior.cs:11)
(Filename: C Line: 0)
Invalid SceneHandle
(Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Camera/UnityScene.cpp Line: 283)
Invalid SceneHandle
(Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Camera/UnityScene.cpp Line: 283)
Waiting for finish
Dont really know whats causing the invalid scene handle. And the Editor logs didnt seem to show any errors, just logs of all the assets loading and their sizes...
Just a note, I have tried re-importing all assets, re-installing Unity, placing all assets into the "Resource" folder.
So looking at the logs when I Build and Run just one of the scenes and the Character $$anonymous$$odel does show up. The Invalid SceneHandle is not present in the logs... so what ever is causing that error is most likely the cause... And it is being caused when Building multiple scenes only
I'm also getting similar problem. I'm trying to export PC Standalone using Windows Platform into C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats.exe The output log is as follows
----------------------------------------------
GfxDevice: creating device client; threaded=1
Direct3D:
Version: Direct3D 9.0c [aticfx32.dll 8.17.10.1094]
Renderer: ATI Radeon HD 5700 Series
Vendor: ATI
VRA$$anonymous$$: 1014 $$anonymous$$B (via DXGI)
Caps: Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=1 DF24=1 INTZ=1 RAWZ=0 NULL=1 RESZ=1 SlowINTZ=1
desktop: 1920x1080 60Hz; virtual: 1920x1080 at 0,0
<I> Initializing (RawInput).
<RI> Input initialized.
Begin $$anonymous$$ono$$anonymous$$anager ReloadAssembly
Platform assembly: C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\UnityEngine.dll (this message is harmless)
Loading C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\UnityEngine.dll into Unity Child Domain
Platform assembly: C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-CSharp-firstpass.dll (this message is harmless)
Loading C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-CSharp-firstpass.dll into Unity Child Domain
Platform assembly: C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-CSharp.dll (this message is harmless)
Loading C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-CSharp.dll into Unity Child Domain
Platform assembly: C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-UnityScript-firstpass.dll (this message is harmless)
Loading C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-UnityScript-firstpass.dll into Unity Child Domain
Platform assembly: C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-UnityScript.dll (this message is harmless)
Loading C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Assembly-UnityScript.dll into Unity Child Domain
- Completed reload, in 1.407 seconds
Platform assembly: C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\System.dll (this message is harmless)
Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
Unloading 2 unused Assets to reduce memory usage. Loaded Objects now: 779. Operation took 6.237454 ms.
Platform assembly: C:\Work\S$$anonymous$$YI_Flats_v06\PC\Skyi_Flats_Data\$$anonymous$$anaged\Boo.Lang.dll (this message is harmless)
Invalid SceneHandle
(Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Camera/UnityScene.cpp Line: 283)
Invalid SceneHandle
(Filename: C:/BuildAgent/work/b0bcff80449a48aa/Runtime/Camera/UnityScene.cpp Line: 283)
--------------------------
Can anybody suggest me some workaround?
Answer by pravinyadav · Jul 11, 2012 at 05:18 AM
Trace and check, if you are using some third party plugin (mostly with some GUI elements), which might cause some serialization issues. Simply avoid it and use Unity native GUI calls. Otherwise merge all the levels in single scene file and load it from there. (stupid solution)
Thanks pravinyadav. You r right. It was a problem with NGUI.
Answer by OZAV · Apr 27, 2014 at 11:54 AM
Same problem here, missing resources, every time i make a build ... nothing works when deployed ... it looks that - Unity still has a long way to go, in order to be doing things properly.
Poor people who pay fror the Pro versions so far ... feel so sorry for them - you have an engine that looks like it can make the game for you, but when you do all the hard work - you find that you have been screwed by the way the things work in the engine ...
Could they make this default to accept everything in the build unless we exclude it by tagging it ?
Answer by cecker · Mar 07, 2014 at 03:34 AM
I had a similiar problem on iOS. I got rid of it by calling "Resources.UnloadUnusedAssets();" just before transferring to other scene. (This seems to be absurd: The error message I had before was "Unloading n unused Assets to reduce memory usage.". Now I'm unloading them by myself...)
Your answer
Follow this Question
Related Questions
Cloud recognition in Vuforia 0 Answers
Unity3D 3.0 Pro 4 Answers
How to climb up a ladder!! 1 Answer
Yield aint working in C# code. 1 Answer
Unresponsive collier at small objects and high speeds 1 Answer