‘’’
public class DeathHandler : MonoBehaviour
{
[SerializeField] private Canvas gameOverCanvas;
private void Start()
{
gameOverCanvas.enabled = false;
}
public void HandleDeath()
{
gameOverCanvas.enabled = true;
Time.timeScale = 0;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
}’’’
‘’'public class SessionLoader : MonoBehaviour
{
private Scene currentScense;
private void Start()
{
currentScense = SceneManager.GetActiveScene();
Debug.Log(currentScense.buildIndex);
}
public void ScenseReload()
{
Time.timeScale = 1;
SceneManager.LoadScene(currentScense.buildIndex);
Debug.Log("reload scene");
}
public void QuitGame()
{
Application.Quit();
Debug.Log("quit");
}
}’’’
when the time.tiemscale =0 is triggered. the system is freezed. but it i comment the tiem.tiemscale =1 in the scense reload, the player still can move up, move down and turn around. the player still can shoot and destroyt the enemy. but all effect and enemy movement is freezed.
i tried to un-comment the time.timescale =1, i got the same result as commented the time.timescale = 0;
can you give any suggestion?