- Home /
Question by
hardmode2236 · Jun 02, 2013 at 11:58 PM ·
errortimefloatdeltatime
ERROR: It is not possible to invoke an expression of type 'float'.
totally stumped by this error... I know its gotta be something simple i just cant see it.\
#pragma strict
var sounds : AudioSource[];
var nextShot : float;
var shootSpeed : float;
function Start ()
{
sounds = gameObject.GetComponents.<AudioSource>();
}
function Update ()
{
nextShot+=Time.deltaTime(); //error here
if(nextShot>shootSpeed)
{
nextShot=0;
Debug.Log("PEW");
}
}
the error is: BCE0077: It is not possible to invoke an expression of type 'float'.
Comment
Best Answer
Answer by Benproductions1 · Jun 03, 2013 at 12:02 AM
Time.deltaTime
is not a function. It is a variable. You cannot call/invoke a variable (Unless it's a pointer to a function)
Benproductions1
Your answer
Follow this Question
Related Questions
Pause game that not using deltatime for movment 1 Answer
Enum is thought to be a float? 2 Answers
How can I get correct figure from formula of float 1 Answer
Start timer with trigger 1 Answer