Instantiated object's transform changes according to parent object's rotation

I have an Object(parent) having 4 spawn points around it which spawns stars. In the game, Parent object rotates but the Spawned stars don’t move according to Parent objects rotation. I have tried all the suggestions people have given in the forum.

    public GameObject starPrefab;
    private GameObject newStarPrefab;
    public Transform[] starSpawnPoints;

	void Start () {
        if (!GameObject.FindGameObjectWithTag("Box"))
        {
                RandomPoint();
        }
    }

    void RandomPoint()
    {
        int randomIndex = Random.Range(0, starSpawnPoints.Length);

        for (int i = 0; i < starSpawnPoints.Length; i++)
        {
            if (randomIndex == i)
            {
                newStarPrefab =  Instantiate(starPrefab, starSpawnPoints*.position, Quaternion.identity);*

newStarPrefab.transform.parent = gameObject.transform;
}
}
}
I have added this script to the Parent object which rotates after spawning.

Hello @Ki4Chan !

As i can see, you instantiate the objects with position starSpawnPoints*. As i understand, this transfomrs are the spawns transforms that should move when the parent rotate.*
In the scene, do you see the spawns moving? I can’t tell you why is happen this, but try this things to check:
Try to chech if the spawn poitns move when parent rotates.
before Instantiating the starPrefab, do a
foreach (Transform TransformSpawn in starSpawnPoints)
{
Debug.Log (TransformSpawn.position + " - " + TransformSpawn.name)
}
To check all SpawnPoints position. Or even try it in the Update if the is rotating all time
You can also try to Instantiate directly to be the child of a transform, using this:
Instantiate (starPrefab, transform);
If this helps, upvote and check the answer!
If need more help, give more info and use the @tormentoarmagedoom
Bye :smiley: