Parenting MOVING objects during RUNTIME C#

public bool platformMaxed = false;
public static int platformSpawned;
public GameObject PlatformPre;
public GameObject ParentObject;

	public Transform platformChild;

	
	void Start () 
	{
		StartCoroutine(PlatformSpawning());
	}
	

	public IEnumerator PlatformSpawning()
	{
		while (platformMaxed ==false)
		{
			for (platformSpawned = 0 ;platformSpawned <= 3; platformSpawned++)
			{

				Instantiate(PlatformPre, 
				new Vector3(Random.Range(-15,15),Random.Range(1,15),0),
				Quaternion.identity);
				Debug.Log("Platform Spawned" + platformSpawned);
				
				if (platformSpawned >= 3)
					{
						platformMaxed = true;
						break;
					}
			}
			
			if (platformMaxed == true)
				yield break;
			
			yield return 0;
			
			
		}
			
	}
	
	public void SpawnSinglePlatform()
	{
		Instantiate (PlatformPre, 
		new Vector3(Random.Range(-15,15),Random.Range(1,15),0),
		Quaternion.identity);
		Debug.Log("Platform Spawned" + platformSpawned);
	}
	
	
	void Update () 
	{
	}

What I need is, when the object is instantiated it gets parented to a Rotating Sphere object.

I can NOT use:
Transform platformChild;
platformChild = Instantiate(PlatformPre, New Vector3…) as Transform;
As that will give me the following error:
Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption.

Alternatively, how would I go about rotating an object based on the pivot of another object?

The error says you’re trying to change the raw prefab, the blueprint object. In your case, something like PlatformPre.parent=. You can change the newly created gameObject all you want. Once it’s spawned, it’s the same as any other gameObject.

Follow your line Transform platformChild; platformChild = Instantiate(PlatformPre, New Vector3...) as Transform; with platformChild.parent=. You should be able to set platformChild.rotation to whatever you like, as well.