- Home /
Preserving a scene while loading anather scene using ui button
hello, i am working on a vr projcet in which the main camera is in one scene. i made a ui element in which button changes the scene. my porblem is that while loading, it destory/ unload the main camera scene and give the error " no camera to render" can any one help me with that
Comment
Try using Scene$$anonymous$$anager.LoadSceneAsync(sceneNameOrIndex);
Answer by dishant27 · Feb 28, 2018 at 08:43 PM
use this method on camera:
void Awake()
{
DontDestroyOnLoad(transform.gameObject);
}