- Home /
Question by
Skeletti · Oct 05, 2015 at 02:20 PM ·
unity 5freezeloadlevelapplication.loadlevel
Application.LoadLevel(Application.LoadedLevel) causes freeze
Hi there, have some issue with the Application.loadedLevel() methodcall.
My application activates a canvas if the player health <= 0 and set Time.timeScale to 0.
If I click the retry button it loads the actual loaded level again. Unfortunately everything is freezed after the level has been loaded. Thank u guys in advance!
Provide some Code:`
void Start () {
deathUI.SetActive(false);
}
// Update is called once per frame
void Update() {
if (attComp.getHealth() <= 0)
{
deathUI.SetActive(true);
Time.timeScale = 0;
}
}
public void retry()
{
Time.timeScale = 1;
Application.LoadLevel(Application.loadedLevel);
}
Comment