I need to obtain the children of the ui text so I can switch scenes . The script I have made out is not working . When I press play the scenes the switch . What I trying to do is carry over the text.
I just need this score script corrected :
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ScoreManagerScript : MonoBehaviour
{
public static int score;
private Text text;
void Awake()
{
text = GetComponent <Text> ();
score = 0;
DontDestroyOnLoad(transform.gameObject);
}
void Update()
{
text.text = "Score: " + score;
Debug.Log("Score: " + score);
}
}