- Home /
why doesnt this script work
I want to make it so if my panel is active then Time.timescale = 0, paused. I made a code but every time i try it the game just wont stay paused and my play button dissapears but the panel stays.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Play : MonoBehaviour
{
public GameObject Panel;
void Paused ()
{
Panel.SetActive(true);
Time.timeScale = 0;
}
public void Start()
{
Panel.SetActive(false);
Time.timeScale = 1;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612211536im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to Pause game 1 Answer
Is It Bad To Have Your Jump In Update()? 3 Answers
Time goes to fast for the code. (C#) 2 Answers
Ideas for Animating while Paused? 9 Answers