Выдаёт ошибку когда пытаюсь получить переменную из другого скрипта c#
Выдаёт ошибку когда пытаюсь получить переменную из другого скрипта c# Вот ошибка
UnassignedReferenceException: The variable checkTiem of DoubleTapTime has not been assigned. You probably need to assign the checkTiem variable of the DoubleTapTime script in the inspector. UnityEngine.GameObject.GetComponent[T] () (at <1245d947a91b4a14b7c7e2c7335512b2>:0) DoubleTapTime.OnMouseDown () (at Assets/Scripts/DoubleTapTime.cs:11) UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32)
Вот код
using System.Collections.Generic;
using UnityEngine;
public class DoubleTapTime : MonoBehaviour
{
public GameObject checkTime1;
public void OnMouseDown()
{
CheckTime t = checkTime1.GetComponent<CheckTime>();
if (t.time > 35)
{ t.time = 40; }
else { t.time += 5;}
}
}