I have not had problems with this script in the past… and all of a sudden it has started doing this: ‘Time’ does not contain a definition for 'timeScale’
using UnityEngine;
using System.Collections;
public class PauseScript : MonoBehaviour {
public GameObject transGray;
public GameObject playButton;
public bool paused;
void Start ()
{
paused = false;
playButton.SetActive(false);
transGray.GetComponent<Renderer>().enabled = false;
}
void Update ()
{
}
public void Pause()
{
paused = !paused;
if (paused)
{
Time.timeScale = 0f;
playButton.SetActive(true);
transGray.GetComponent<Renderer>().enabled = true;
}
else if (!paused)
{
Time.timeScale = 1f;
playButton.SetActive(false);;
transGray.GetComponent<Renderer>().enabled = false;
}
}
}