How to add in my script that my prefabs instantiate as children of the player character who is also an instantiated prefab?

Hi there, this is my first post here so apologies if I mess something up. Below is the code I currently have for my spawner. It works, but I need the clones to become children of the player character when they spawn into the game world. The problem is, the player is also an instantiated prefab, and I’m not quite sure how to add this functionality to my script. Any help would be appreciated.

  using UnityEngine;
  using System.Collections;

   public class ChaserSpawner : MonoBehaviour
   {

//The method of spawning (random = choose a spawn point randomly; onebyone = spawn an object on spawnpoint #1 , the next will be spawned on spawnpoint #2 ,...)
public enum SpawnType { Random, OneByOne }

[Header("Main parameters")]
public SpawnType spawnType;
public GameObject[] spawnPoints;    //The array that will contain the different spawn points
public string toSpawnResourceName = "Chaser1";
[Header("Extra parameters")]
public int numberOfObjectsToSpawnOnContact = 1;
public int maxGameobjectsToSpawn = 0;

private int nextSpawnPointIndex = 0;
private int spawnedObjects = 0;
private GameObject toSpawn;

// Use this for initialization
void Start()
{
	toSpawn = Resources.Load("Chaser1") as GameObject;    //Load the gameobject to spawn from resources
}

void OnTriggerEnter2D(Collider2D other)
{
	if (GetComponent<Collider2D>().tag == "Player") //Check for what you want about the collider here
	{
		SpawnAnObject();
	}
}

private void SpawnAnObject()
{
	if (spawnedObjects >= maxGameobjectsToSpawn)    //If enough objects spawned , stop here
		return;

	for (int i = 0; i < numberOfObjectsToSpawnOnContact; i++)
	{
		GameObject spawnPoint = spawnPoints[0]; //Set a default spawnpoint to avoid errors

		if (spawnType == SpawnType.Random)
		{
			spawnPoint = spawnPoints[Random.Range(0, spawnPoints.Length)];
		}
		else if (spawnType == SpawnType.OneByOne)
		{
			spawnPoint = spawnPoints[nextSpawnPointIndex];
			nextSpawnPointIndex++;
			if (nextSpawnPointIndex >= spawnPoints.Length)
				nextSpawnPointIndex = 0;
		}

		Instantiate(toSpawn, spawnPoint.transform.position, Quaternion.identity);   //Spawn the wanted GameObject
		spawnedObjects++;       //Increment the number of spawned object
	}
}

}

You only need a reference to your player, and make transform of this reference parent of your spawned object, this is your code, I only added 3 new lines, with this simbol on top line /* -------------------------------- */

Should be works fine

 /* -------------------------------- */
    public Transform player; // Or transform you need set parent of your spawned objects

    //The method of spawning (random = choose a spawn point randomly; onebyone = spawn an object on spawnpoint #1 , the next will be spawned on spawnpoint #2 ,...)
    public enum SpawnType { Random, OneByOne }
    [Header("Main parameters")]
    public SpawnType spawnType;
    public GameObject[] spawnPoints;    //The array that will contain the different spawn points
    public string toSpawnResourceName = "Chaser1";
    [Header("Extra parameters")]
    public int numberOfObjectsToSpawnOnContact = 1;
    public int maxGameobjectsToSpawn = 0;
    private int nextSpawnPointIndex = 0;
    private int spawnedObjects = 0;
    private GameObject toSpawn;
    // Use this for initialization
    void Start()
    {
        toSpawn = Resources.Load("Chaser1") as GameObject;    //Load the gameobject to spawn from resources

        /* -------------------------------- */
        player = GameObject.FindGameObjectWithTag("Player").transform;  //Find the player gameObject, make sure have tag named Player
    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (GetComponent<Collider2D>().tag == "Player") //Check for what you want about the collider here
        {
            SpawnAnObject();
        }
    }
    private void SpawnAnObject()
    {
        if (spawnedObjects >= maxGameobjectsToSpawn)    //If enough objects spawned , stop here
            return;
        for (int i = 0; i < numberOfObjectsToSpawnOnContact; i++)
        {
            GameObject spawnPoint = spawnPoints[0]; //Set a default spawnpoint to avoid errors
            if (spawnType == SpawnType.Random)
            {
                spawnPoint = spawnPoints[Random.Range(0, spawnPoints.Length)];
            }
            else if (spawnType == SpawnType.OneByOne)
            {
                spawnPoint = spawnPoints[nextSpawnPointIndex];
                nextSpawnPointIndex++;
                if (nextSpawnPointIndex >= spawnPoints.Length)
                    nextSpawnPointIndex = 0;
            }



            GameObject ObjectSpawned =  Instantiate(toSpawn, spawnPoint.transform.position, Quaternion.identity);   //Spawn the wanted GameObject

            /* -------------------------------- */
            ObjectSpawned.transform.parent = player; // Set the spawned Object, child of player

            spawnedObjects++;       //Increment the number of spawned object
        }
    }