hi . i want to make a popup window when the character die with UI . i made a pause bool in character script and it works . in canvas script i want to say when pause is true ( or time.deltatime = 0 ) show the canvas . i wrote this in canvas script but it doesn’t work .
void Start ()
{
gameObject.SetActive (false);
}
void Update ()
{
if(GameObject.Find ("ball").GetComponent<ball_script>().pause)
{
gameObject.SetActive (true);
}
}
}
and this is part of the script for my character:
public bool pause = false;
void Update()
{
if(dead)
{
deathCooldown -= Time.deltaTime;
if(deathCooldown <= 0)
{
if(pause = true )
{
Time.timeScale = 0;
}
}
}
}