0
\$\begingroup\$

For some reason when i create the gameobjects they are places like mirror. And i'm not sure how to rotate them back.

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);
        }

pointsList is a List For example in index 4 X = 3 Y = 17

But i'm not sure why it's creating the objects mirrored. And how to rotate it back.

In the screenshot it should be written Hello World but it looks mirror. The empty GameObject rotation is 0,0,0 and each child Cube rotation also 0,0,0

HW

\$\endgroup\$
0
\$\begingroup\$

Solution: Either to change each cube position by adding minus to the X the Z axis: cube.transform.position = new Vector3(pointsList[i].Y, 0, -pointsList[i].X); or to rotate the parent GameObject by -180 like this transform.Rotate(0, 0, -180);

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.