Im trying to run one of the examples in the documentations:
// Prints 0
print (Time.time);
// Waits 5 seconds
yield WaitForSeconds (5);
// Prints 5.0
print (Time.time);
But it gives me the error ‘time’ is not a member of ‘Time’.
Any idea of why?
Im trying to run one of the examples in the documentations:
// Prints 0
print (Time.time);
// Waits 5 seconds
yield WaitForSeconds (5);
// Prints 5.0
print (Time.time);
But it gives me the error ‘time’ is not a member of ‘Time’.
Any idea of why?
Show us your import/using statements, and try the following:
// Prints 0
print (UnityEngine.Time.time);
// Waits 5 seconds
yield WaitForSeconds (5);
// Prints 5.0
print (UnityEngine.Time.time);
that’s all the script
Then try my version.
It works!
Thanks mate.
Somewhere you’ve created a script (etc?) called ‘Time’ - and the compiler used that one instead of the default UnityEngine one.