#Loaded scene is empty in build

1 messages · Page 1 of 1 (latest)

topaz sparrow
#

I have a subscene loaded with EntitySceneReference that has a baker with some prefabs that get converted. Everything works in Editor but in Build I get this error:

  at Unity.Entities.EntityManager.Instantiate (Unity.Entities.Entity srcEntity) [0x00012] in <d1cbafd757cf4a32aaa19f9c9a1e11c1>:0
  at InstanceData.NewObject (Unity.Entities.EntityManager em, Unity.Entities.Entity entity, System.Byte objectType, Unity.Mathematics.float3 position, System.Single yaw) [0x00000] in <ca09017540c54029aebc78c813224ce4>:0
  at InstanceData.NewPlayerObject (Unity.Entities.EntityManager em, Unity.Entities.DynamicBuffer`1[T] players, Unity.Entities.Entity entity, Client client, Unity.Mathematics.float3 position, System.Single yaw) [0x00000] in <ca09017540c54029aebc78c813224ce4>:0
  at NetworkManager.JoinTavern (Client client) [0x00088] in <ca09017540c54029aebc78c813224ce4>:0
  at Client.Initialize () [0x00051] in <ca09017540c54029aebc78c813224ce4>:0
  at Client.Auth () [0x000b6] in <ca09017540c54029aebc78c813224ce4>:0
  at NetworkManager.OnUpdate () [0x000ec] in <ca09017540c54029aebc78c813224ce4>:0
  at Unity.Entities.SystemBase.Update () [0x0004e] in <d1cbafd757cf4a32aaa19f9c9a1e11c1>:0
  at Unity.Entities.ComponentSystemGroup.UpdateAllSystems () [0x0007a] in <d1cbafd757cf4a32aaa19f9c9a1e11c1>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems()
Unity.Entities.ComponentSystemGroup:OnUpdate()
Unity.Entities.SystemBase:Update()
Unity.Entities.DummyDelegateWrapper:TriggerUpdate()```
kind zealot
#

need code and what exactly is null

topaz sparrow
#

the code is literally just em.Instantiate(entity);

#

actually nothing works in the loaded subscene except the fact it gets loaded I think (Streamed scene with 35ms latency from /root/GameServer/dark_Data/StreamingAssets/EntityScenes/14e7242b07f58ad488c55cbfa186338a.0.entities)

#

my system doesn't even run

#

again in Editor everything works perfect

#

this is how I bake the Scenes

public struct SceneLoader : IComponentData {
    public EntitySceneReference SceneReference;
}

#if UNITY_EDITOR
public class SceneLoaderAuthoring : MonoBehaviour {
    public UnityEditor.SceneAsset Scene;

    class Baker : Baker<SceneLoaderAuthoring> {
        public override void Bake(SceneLoaderAuthoring authoring) {
            var entity = GetEntity(TransformUsageFlags.None);
            AddComponent(entity, new SceneLoader {
                SceneReference = new EntitySceneReference(authoring.Scene),
            });
        }
    }
}
#endif```
#

and how I load them cs var world = new World(name, WorldFlags.Game); var systemTypes = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default).Where(type => type != typeof(NetworkManager)); DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(world, systemTypes); ScriptBehaviourUpdateOrder.AppendWorldToCurrentPlayerLoop(world); SceneSystem.LoadSceneAsync(world.Unmanaged, scene);

kind zealot
#

show failing code

topaz sparrow
#

there is no failing code I realized

#

nothing in the loaded scene seems to happen

#

not even any system run

#

like it loads an empty scene or something, not a clue why it all breaks in build

topaz sparrow
#

Loaded scene is empty in build

lofty gull
#

Ever find an answer to this?