I want to start a timer once a gameobject is destroyed, anyone has ideas on doing it? A scenario would be if a cube is destroyed, the timer then commences
You can use OnDestroy() here
private void OnDestroy()
{
gameManager.isStartTimer = true;
}
and in gameManger class Timer:
bool isStartTimer;
int timer;
private void Update()
{
if(isStartTimer)
{
timer += Time.deltaTime;
Debug.Log(timer);
}
}