I am just testing out a simple timer that will provide some later logic in my game. I want this message to log into my Unity debug console whenever 30 seconds has passed in the scene, but it is not happening… Am I going crazy or did I make some stupid silly mistake??
using UnityEngine;
using System.Collections;
public class TestingTimer : MonoBehaviour
{
private float startTime;
void Start ()
{
startTime = Time.timeSinceLevelLoad;
}
void Update ()
{
float currentTime = Time.timeSinceLevelLoad - startTime;
if (currentTime == 30f)
{
Debug.Log("Time is 30!!");
}
}
}