How to unlink a prefab via c#

Hello. So I am instantiating this prefab into the world, but the problem is they are all connected. I want them to act like they are all a separate object, but can’t find out how. So this way when I destroy an object that was spawned into the scene, they don’t all get destroyed. I hope this makes sense. I am coding in c#, here it is:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemySpawner : MonoBehaviour {

[SerializeField] float secondsBetweenSpawns;
[SerializeField] GameObject enemyToSpawn;
[SerializeField] int enemiesInScene;
[SerializeField] int desiredEnemiesInScene;
[SerializeField] Transform Parent;
[SerializeField] PathFinder pathFinder;
void  Start() {
    StartCoroutine(Spawner());
}

 IEnumerator Spawner()
 {
   while (enemiesInScene < desiredEnemiesInScene)
   {
        yield return new WaitForSeconds(secondsBetweenSpawns);
        print("Spawning Enemy");
        Spawn(); 
        enemiesInScene = enemiesInScene + 1;
        print(enemiesInScene);
    }
   if (enemiesInScene == desiredEnemiesInScene)
    {
        // do nothing
    }
}
void Spawn()
{
    float whereToSpawnEnemyX = pathFinder.startingWaypoint.transform.position.x;
    float whereToSpawnEnemyZ = pathFinder.startingWaypoint.transform.position.z;
    Vector3 whereToSpawnEnemy = new Vector3(whereToSpawnEnemyX, 20f, whereToSpawnEnemyZ);
    GameObject spawnedInEnemy = Instantiate(enemyToSpawn, whereToSpawnEnemy, Quaternion.Euler(0, 90, 0));
    spawnedInEnemy.transform.parent = Parent;
}

}

The simplest way would be to remove spawnedInEnemy.transform.parent = Parent; so they each spawn individually. The other way would be to tag them and remove the parent manually like this…

GameObject[] foundEnemies = GameObject.FindGameObjectsWithTag("enemy"); 

for(int i = 0; i < foundEnemies.Length; i++)
{
foundEnemies*.transform.parent = null;* 

}

Hi, thank you that fixed the problem! Now I have one more, I am instantiating the object with the y position being 20f, but when it spawns in it is 0. Why is that? Here is the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemySpawner : MonoBehaviour {

[SerializeField] float secondsBetweenSpawns;
[SerializeField] GameObject enemyToSpawn;
[SerializeField] int enemiesInScene;
[SerializeField] int desiredEnemiesInScene;
//[SerializeField] Transform Parent;
[SerializeField] PathFinder pathFinder;
void  Start() {
    StartCoroutine(Spawner());
}

 IEnumerator Spawner()
 {
   while (enemiesInScene < desiredEnemiesInScene)
   {
        yield return new WaitForSeconds(secondsBetweenSpawns);
        print("Spawning Enemy");
        Spawn(); 
        enemiesInScene = enemiesInScene + 1;
        print(enemiesInScene);
    }
   if (enemiesInScene == desiredEnemiesInScene)
    {
        // do nothing
    }
}
void Spawn()
{
    float whereToSpawnEnemyX = pathFinder.startingWaypoint.transform.position.x;
    float whereToSpawnEnemyZ = pathFinder.startingWaypoint.transform.position.z;
    Vector3 whereToSpawnEnemy = new Vector3(whereToSpawnEnemyX, 20f, whereToSpawnEnemyZ);
    Instantiate(enemyToSpawn, whereToSpawnEnemy, Quaternion.Euler(0, 90, 0));
}

}

I will put it on another question, thanks!