Resetting scene time after 13 seconds
I am tring to put together an animated demo in unity and would like to make it loop. I have tried making all the animation keys loop but after one loop it losses timing. So i figured if I had a script that would reset the scene time back to 0 after say 15 seconds it would accomplish the same thing.
Comment
Answer by OncaLupe · Nov 12, 2015 at 04:41 AM
This can be placed in any object in the scene. Just reloads the current scene after the delay set in the Invoke call.
using UnityEngine;
public class SceneResetOnDelay : MonoBehaviour
{
void Start()
{
Invoke("ResetScene", 15f);
}
void ResetScene()
{
Application.LoadLevel(Application.loadedLevel);
}
}
Your answer
Follow this Question
Related Questions
Destroying bullets after a certain amount of time 1 Answer
GAME - profit simulating after game is close - ANDROID 0 Answers
Problem with a stopwatch 0 Answers
Instantiate objects in for loop 0 Answers