I'm trying to spawn an object once another object has been destroyed how do i do that.

public class SpawnFire : MonoBehaviour
{
public bool iscreated = false;
public GameObject Smallfire;

void OnCollisionEnter (Collision col)
{ 

	if (col.gameObject.name == "GameFire") {
		Destroy (col.gameObject);
		iscreated = true;
	}
}

void update() 
	{
		if (iscreated) 
	 	{
			Debug.Log ("smal fire has spawned!!");
			Quaternion spawnRotation = Quaternion.identity;
			Vector3 spawnPosition = new Vector3 (
				0, 0, -6.5f);
			Instantiate (Smallfire, spawnPosition, spawnRotation);
			iscreated = false;
	 	}

	}
}

Is this script on the object that is getting destroyed by the: Destroy (col.gameObject); ?
If so, the script won’t be around in order to spawn something. To handle that, you would have to spawn the new object before destroying the old object.

thats what im trying to figure out but idk how im trying to switch the object after its hit