recording time.(sorted)

Hi
How can i record the current time as a float in update.
I’v tried
float timer = Time.fixedTime;
float timer = Time.time;

void Update () {
timer = Time.fixedTime; // and some others but they throw an error can only be called from the main thread
timer = Time.time;

Any ideas?

I think it’s because you tried to get time outside of a function, so try something like:

float timer;
void Update () { 
timer = Time.time;

Sweet bro that did the trick .
Thx