How to script independent time tracking of prefabs?

Hey friends,

i want to instantiate a prefab with a script attached to it. The script has a time dependent variable.
Problem is:

  • The value starts changing right after starting the game, NOT with instantiation of the prefab.
  • Every prefab shares the same value, instead of being independend.

So i want to track the time of each prefab individually, with the instantiation as the beginning, NOT the game start.

Hope you can help me, thanks!

@Hardfaile Easy fix for you will be something like this:

private float prefabStartingTime;
private float prefabCurrent;
            private void Awake()
            {
                prefabStartingTime = Time.time;
            }
    
            private void Update()
            {
                prefabCurrent = Time.time - prefabStartingTime;
            }