#How to Reload Scen

1 messages · Page 1 of 1 (latest)

median umbra
#

Im using the code:

        var entityManager = Unity.Entities.World.DefaultGameObjectInjectionWorld.EntityManager;
        entityManager.DestroyEntity(entityManager.UniversalQuery);
        SceneManager.LoadScene(SceneManager.GetActiveScene().name, LoadSceneMode.Single);```


But on reload unity starts throwing errors about my singletons, probably not clearing up the subscenes or smth

`InvalidOperationException: GetSingleton<DOTSSurvivor.InputState>() requires that exactly one entity exists that match this query, but there are none. Are you missing a call to RequireForUpdate<T>()? You could also use TryGetSingleton<T>()`