[72037-ui-canvas.zip|72037]
I want to switch scenes . I am having a problem doing that . I’ve change the operators and let time reach zero and the scene still dont change. I google the problem and its because ui canvas dont change on web player. This game is for androids and ios. Read about some ui canvas group . I also read about using a but to change scenes. I dont want to use a button . I just want the scenes to switch when the timer reaches zero and the points gotta be lower than the point set. I have scripts save in a document
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
public class Timer : MonoBehaviour
{
public float TimeRemaining = 1;
public string SceneToLoad;
public void Update()
{
if (TimeRemaining > 0) {
TimeRemaining -= Time.deltaTime;
} else {
Application.LoadLevel (SceneToLoad);
}
}
}
Hey try this code, the Timer.cs that I’ve developed decades ago
You need to add the using tag “using UnityEngine.SceneManager;” if you want to load different scenes.
Once you have that, put “SceneManager.LoadScene(“SceneNameGoesHere”);”. Hope this helped!