Null Reference Exception - Time.deltatime problem

I’m new to unity and I’m in need of help with javascript.
Everytime i use in my code Time.deltatime i get a following error:

NullReferenceException: Object
reference not set to an instance of an
(System.String operatorName,
System.Object lhs, System.Object rhs)
DestroyAfterTimeScript.Update () (at

From my understanding of this error i tried to access a reference variable that isn’t referencing any object. Yet I stumble upon this error every time i use Time.deltatime in my code, which should work just fine, since i’m referring to a time function.
Or maybe I’m wrong, and the problem is much more simple, but since I get this error only when using Time.deltatime, i can’t figure out what I’m doing wrong.

The script isn’t named “Time”, or anything like this. (I red about similar problem, where the solution was to just change the name of the script from “Time” to something else, but it’s not the case since my script is named “DestroyAfterTimeScript”)

This code is supposed to destroy the object after a certain number of seconds, with a little bit of randomization.
So, here it is:

var destroyAfterTime : float = 10;
var destroyAfterTimeRandom : float = 0;
var countToTime : float;

function Awake () {
	destroyAfterTime += Random.value * destroyAfterTimeRandom;

function Update () {

	countToTime += Time.deltatime;
	if (countToTime >= destroyAfterTime)

Error points me to the line 12:

	countToTime += Time.deltatime;

Any help would be very appreciated.

Oh, and by the way I’m following ETeeski tutorials, there you can probably find more details of the code i’m trying to get to work. He doesn’t seem to have any problems, and his bulletholes disappear just fine. I copied every line of his code, and still it’s not working.

Link to the tutorials: FPS1.14 Bullet Hole Destroy Timer. Unity3D FPS Game Design Tutorial. - YouTube


Note that the “T” is capitalized in deltaTime