I am making a game that needs a timer. I am very noob at scripting and unity. my problem is the text I want to use to the timer. I cant drag the text to the inspector
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Timer : MonoBehaviour
{
public Text timerText;
private float startTime;
// Start is called before the first frame update
void Start()
{
startTime = Time.time;
}
// Update is called once per frame
void Update()
{
float t = Time.time - startTime;
string minutes = ((int)t / 60).ToString();
string seconds = (t % 60).ToString();
timerText.text = minutes + ":" + seconds;
}
}
i dont know if that pictrues help.