How to not Destroy an object when changing over to the next scene?

Hello, I really could use some help with this. How do I not destroy a canvas and all of its children in it, when I am changing from one scene to the next?

Thanks.

Have you tried this?

Object.DontDestroyOnLoad might be what you’re looking for.

Basically, create a new script and name it whatever you want (eg surviveNewScene.cs).

Add this to it:

// Make this game object and all its transform children
// survive when loading a new scene.
void Awake () {
    DontDestroyOnLoad (transform.gameObject);
}

Add the script to your canvas. Make sure to add it to the topmost parent.