How do I call an DontDestroyOnLoad function on UI text

I called an don’tdestroyOnLoad function on two scripts and it doesn’t seem to work . I need to carry the ui text over to the next scene. I don’t have any errors . I also tried to fix this problem by adding a gameobject tag in the awake function on the test script. I don’t know what to do from here. I need help .

using UnityEngine;

using System.Collections;

using UnityEngine.UI;

using UnityEngine.SceneManagement;

public class Test : MonoBehaviour {

private MyClockScript myClock;

public GameObject Score;

private ScoreManagerScript scoremanager;

void Awake () {

myClock = GetComponent();

GameObject Score = GameObject.FindWithTag(“Tip”);

scoremanager = GetComponent();

}


void Update () 
{
	if (myClock.m_leftTime < 0 && 0 < ScoreManagerScript.score)

	{

		SceneManager.LoadScene("j");
		
	}

}

}

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class ScoreManagerScript : MonoBehaviour
{

 public static int score;
 

 private Text text;
 
 void Awake ()
 {

text = GetComponent ();

score = 0;

DontDestroyOnLoad(gameObject);

 }


 
 void Update()
 {

text.text = "Score: " + score;

Debug.Log("Score: " + score);

}

You have to call DontDestroyOnLoad on the root object, here the “canvas” object.
What is happening here is that Unity destroys the canvas when loading a scene, which in turn destroys your UI, even though it was marked DontDestroyOnLoad. If you want only some UI elements to get carried over different scenes, you will have to delete the other ones manually.

Where at do I call a DontDestroyOnLoad on root canvas ? Delete what I dont understand.