How do I reset a script when cloning it?

Hello!
I am trying to make a bullet that gets destroyed after x seconds, but this causes the original gameObject to get destroyed whichstops me from instantiating it.

void Update()
{
    DestroyTimer -= Time.deltaTime;


    if (DestroyTimer <= 0)
    {
        Object.Destroy(gameObject);
    }
}

How can I reset the script to the original variables/conditions after cloning the object?
(or something that has the same effect)

Why are you timing it yourself? Do you anticipate having to reset that timer?

Otherwise just use the Destroy() call that accepts a second argument of time:

//kill off our newlySpawnedBulletGottenBackFromInstantiate in 2 seconds
Destroy( newlySpawnedBulletGottenBackFromInstantiate, 2.0f);

Spawn it, doom it, forget about it. :slight_smile: