How much time object exist?

Is in Unity some way to check how many frames they exist.

I need to get position of GameObject which exist smallest period of time.

If not say simply no pls :slight_smile:

2 Answers

2

int frames = 0;

void Update(){
frames++;
}

or
flaot startTime = 0;
void Start(){
startTime = Time.time;
}

You can store Time.time or Time.frameCount inside Awake function and then check it back inside OnDestroy function. That can give you the “lifetime” of the object.