Go to Unity3D
r/Unity3D
r/Unity3D
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Members
Online
•
by
anthonyc697
After pulling from git, it says “missing prefab” anyone know how to fix it?
Alright, I think I’ve fixed it. I got my project working in Unity 2019.1 at least — haven’t tried updating Super Tiled2Unity yet, but the old version of Super Tiled2Unity is working, so things are looking good so far. I’m going to make a backup of the whole thing and then try upgrading Super Tiled2Unity.
Before I try that out…
I think I have some insight into what’s causing the «missing prefab» issue in general now, insight that might be helpful for diagnosing the issue in the future:
It seems like the missing prefab issue happens whenever there’s an error with any asset after a Unity upgrade, not just errors with Super Tiled2Unity itself. See, after I upgraded from 2018.2 to 2019.1 this time, I ran into the missing prefab issue. Also had those PNG errors that I screenshotted above again (which went away after I did a Reimport All). I also had a few errors with another asset (TextMeshPro).
I googled around and resolved those TextMeshPro issues, and as soon as I did (and my error log was 100% clean), the Missing Prefab issue for Super Tiled2Unity went away. Maybe Unity just doesn’t want to do anything with the .tmx files until all those other compiler errors are resolved? Weird.
I’m going to try upgrading Super Tiled2Unity to the newest version now. If that goes well, which I think it will at this point, I’ll close the issue. Thanks for all your help so far, @Seanba .
In general avoid huge version jumps in Unity. Rather backup and upgrade a project in incremental steps and each time test between them! Between 5.4.2 (Okt 2016) and 2018.4.17LTS (Feb 2020) there passed over 3 years and a lot of things changed!
Especially the entire prefab system changed as there now are nested Prefabs etc. This might be the problem.
It is also very probable that a Unity git repository uses Git LFS
(large file storage).
In this case certain file types are not pushed into the repository itself but rather to the large file storage. In the git repository the files will then only contain references to where to download these large files.
You can try and
- Download and install
Git LFS
-
Open your
Git Bash
in the repository directory and rungit lfs install
This is needed once for each repository.
-
Download all LFS referenced files for a repository via
git lfs fetch --all
Search Issue Tracker
What happened:
Missing prefabs when you open a project from scene file
Steps to Repo:
1. Create a new project with two/three prefabs. Save the scene afterward.
2. Create one more new project with similar prefabs. Save the scene.
3. Now, from the explorer go to the first project and double-click the scene file.
4. A dialogue box will open up. Click Open.
5. Now after opening the project no. one goto
File > Open Project
Open the second project again and observe the previous scene with missing prefabs
Expected result:
Opens the scene of currently opened project.
Actual result :
Opens the scene of a previously opened project.
Versions reproduced with :
2018.1.0a3,
2017.3.0b8,
2017.3.0b7,
2017.3.0b6,
2017.3.0b5,
2017.3.0b4,
2017.2.0f3,
2017.1.0f3,
5.4.6f2
Environment : Windows 10
Thanks for your reply, Bryan. Here are the answers your questions:
1.
Yes, I unloaded my scenes in the Terrain Loading Manager. When I click on «+ Terrains» there are 4 of them listed. If I click the «Remove Scene» button for all 4 of them, my PlayMode test passes and my build runs.
3.
Yes, I am using a custom player. My scene uses Cinemachine, and I was under the impression (perhaps wrongly?) that I therefore need to use a custom player. In the Gaia Player I have set the camera to be the «Main Camera» object, which has a «CinemachineBrain» component, and I have set the player to be my «Racer» object (it’s a racing game) which has a Rigidbody and is the subject of my CinemachineVirtualCamera so it is always on screen.
I tried changing Gaia Player’s Controller Type to «Flying Camera» and rerunning my PlayMode test and my build — they failed in the same way, however something appears to be setting the Controller Type back to «Custom» so I don’t think I have actually verified if changing this fixes the problem.
2.
I will describe in more detail what happens when I run the Playmode test. Here is the code, it’s very simple.
[UnityTest] public IEnumerator YouCanLoadTheScene() { SceneManager.LoadScene("Demo Track"); yield return null; }
Here is a description of what happens when I run the code:
- Frame 1: Two scenes are loaded, «InitTestScene<number>» and «DontDestroyOnLoad»
- Around frame 8: Scene «InitTestScene<number>» is unloaded, and scene «Demo Track» is loaded.
- One frame later: Sub-scenes «Terrain_1_1_<timestamp>» and «Terrain_0_1<timestamp>» are loaded (but not the other two «Terrain_0_0_<timestamp>» and «Terrain_1_0_<timestamp>»)
- Then the test immediately crashes
- After the test ends, there is only one scene loaded, «Terrain_0_0_<timestamp>». Scene «Demo Track» is not loaded.
I’m seeing a variety of different errors of the form `Tree prefab at index <n> is missing` with varying stack traces. The index `<n>` seems to correspond to the Terrain scene, e.g. typically the test attempts to load two of the Terrain scenes before it crashes so I get errors referring to `index 0` and `index 1`.
Tree prefab at index 0 is missing. UnityEngine.StackTraceUtility:ExtractStackTrace () Gaia.GaiaSessionManager:GetWorldMinMax (single&,single&,bool,Gaia.Stamper) (at Assets/Procedural Worlds/Gaia/Scripts/SessionSystem/GaiaSessionManager.cs:473) Gaia.Spawner:UpdateMinMaxHeight () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:907) Gaia.Spawner:OnEnable () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:793)
Tree prefab at index 0 is missing.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Tree prefab at index 0 is missing. UnityEngine.GameObject:.ctor (string,System.Type[]) GeNa.Core.GeNaRoadsMesh:IHBDMBNGDDL (string,GeNa.Core.GeNaRoadSegment,UnityEngine.Transform) GeNa.Core.GeNaRoadsMesh:AEJPCGMCAPM (GeNa.Core.GeNaSpline) GeNa.Core.GeNaRoadsMesh:Process (GeNa.Core.GeNaSpline,single,single,bool,single,bool,bool,bool,single) GeNa.Core.GeNaRoadExtension:ProcessSpline (GeNa.Core.GeNaSpline) (at Assets/Procedural Worlds/GeNa/Scripts/Runtime/Extensions/GeNaRoadExtension.cs:402) GeNa.Core.GeNaRoadExtension:Execute () (at Assets/Procedural Worlds/GeNa/Scripts/Runtime/Extensions/GeNaRoadExtension.cs:226) GeNa.Core.GeNaSpline:UpdateSpline () GeNa.Core.GeNaSpline:Update ()
Tree prefab at index 0 is missing. UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
Tree prefab at index 0 is missing. UnityEditor.EditorApplication:Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange)
Tree prefab at index 0 is missing. UnityEditor.SceneManagement.EditorSceneManager:OpenScene (string,UnityEditor.SceneManagement.OpenSceneMode) Gaia.TerrainScene:LoadScene (UnityEngine.SceneManagement.Scene,bool&,Gaia.LoadState&,bool) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainScene.cs:457) Gaia.TerrainScene:UpdateLoadState (System.Collections.Generic.List`1<UnityEngine.GameObject>,Gaia.LoadState&,bool&,bool&,bool) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainScene.cs:303) Gaia.TerrainScene:AddRegularReference (UnityEngine.GameObject) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainScene.cs:144) Gaia.TerrainLoaderManager:UpdateTerrainLoadState (Gaia.BoundsDouble,Gaia.BoundsDouble,UnityEngine.GameObject,single,single,single,single) (at Assets/Procedural Worlds/Gaia/Scripts/MultiTerrainSystem/TerrainLoaderManager.cs:1043) Gaia.TerrainLoader:UpdateTerrains () (at Assets/Procedural Worlds/Gaia/Gaia Pro/Scripts/MultiTerrainSystem/TerrainLoader.cs:190) Gaia.TerrainLoader:Awake () (at Assets/Procedural Worlds/Gaia/Gaia Pro/Scripts/MultiTerrainSystem/TerrainLoader.cs:133) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)