First script executed every frame.

Hi!

I have to execute an script before anything else every (non-fixed) frame (sets up some variables, encapsulates Time.delta , …). How can I achieve this?

I’ve been looking at the “execution order” but… either I’m really lost and I don’t understand how it works, or it’s just not what I have to examine in order to achieve my goal.

Thanks a lot,
Kak

p.s. I asked this in the forum, but I just realized it made more sense to be asked here. Sorry for duplicating the question.

If you add your script to the execution order you can simply drag & drop your script before the default time :slight_smile:

thanks, seems to work if I add the script to any object of the scene, otherwise the Update is not called (it seems obvious thinking how unity works).

Is there however any way to execute this always? In example, is there any special object that exists in all scenes where I can attach this script? If not I suppose I’ll just have to have extra care and add the script to an object in every scene.

Thanks a lot!
Kak