Why when creating GameObject: GameObject.CreatePrimitive the gameobjects are mirrored ?

The code:

for (int i = 0; i < pointsList.Count; i++)
        {
            GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
            cube.transform.parent = transform;
            cube.transform.position = new Vector3(pointsList[i].Y, 0, pointsList[i].X);
        }

pointList is List

The result is like a mirror and i’m not sure how to rotate it to be not mirrored.
The empty parent GameObject rotation is 0,0,0 and also each child Cube rotation is 0,0,0

It should be Hello World but it’s mirrored.

What happens if you do this instead?

cube.transform.position = new Vector3(pointsList[i].Y, 0, -pointsList[i].X);
1 Like

Right this is working fine also i found that i can rotate the parent gameobject by -180

transform.Rotate(0, 0, -180);

Thank you.

Alright. Actually I meant to write this (flip in X axis):

cube.transform.position = new Vector3(-pointsList[i].Y, 0, pointsList[i].X);
1 Like