Prefab instantiating problem

Hi, I’m having an issue with functionality in my code. I’m trying to make a shield prefab spawn on and travel with the player prefab by making it it’s child. I’ll post my code below. Any help is much appreciated.

public GameObject PlayerPrefab;
	public GameObject Shield;
	
	void OnTriggerEnter(Collider other)
	{
		

		//GameObject playerClone = GameObject.Find("Player(Clone)");
		if (other.gameObject.name == "Player(Clone)")
		{
			//PlayerScript playerScript;
			//playerScript = other.gameObject.GetComponent<PlayerScript>();
			//playerScript.Score += 100;
			GameObject newOne = (GameObject)Instantiate(Shield, PlayerPrefab.transform.position, PlayerPrefab.transform.rotation);
			newOne.transform.parent = GameObject.Find("Player(Clone").transform;
			
		}
		
		
	}

It looks like you should be setting the position and rotation based on the player’s transform and not on the playerprefab.

Transform player = GameObject.Find("Player(Clone)").transform
GameObject newOne = (GameObject)Instantiate(Shield, player.position, player.rotation);
newOne.transform.parent = player;