Question by
IOWA555666 · Mar 29, 2018 at 12:34 AM ·
scenescene-switchingscene-change
Help setting timer to change Scene
Hello guys,i am very new to developing/unity3D/C# i am trying to make a timer for when it finishes it changes scene,the script i was using was obsolete so it didn't work and caused bugs how can i make a script to change the scene after like 2.5 seconds? Thanks :)
Comment
Best Answer
Answer by IOWA555666 · Mar 29, 2018 at 01:31 AM
Actually i just wrote something that fixed my problem after a few minutes of reading somecode i got up with this:
public class TimerScript : MonoBehaviour { public float timeLeft = 3.0f;
public void Update()
{
timeLeft -= Time.deltaTime;
if (timeLeft <= 0.0f)
{
SceneManager.LoadScene(1);
}
}
i hope it might help someone