Box collider on prefab object changing shape when instantiated in code

Hi, I’m really new to Unity to apologies if I’m missing something basic or if my terminology is not great.

I have a prefab object which is a tile in a scrabble type game, it has a box collider on it. When I load an instance of the tile in the Unity hierarchy it behaves as expected. The problem is that I want to instantiate 100 tiles in c#. When I do this and drop the tile on another object the box collider and the tile seem to take on different shapes and rotations and the tile ends up lodged in the object. Here’s my code and some images of the effect I’m seeing:

GameObject go = Instantiate(tilePrefab, new Vector3(-(x * 1), 30, 0), Quaternion.identity) as GameObject;
        go.transform.SetParent(transform, true);

112952-tile1.png

112953-tile2.png

Any help would be greatly appreciated!

Is the parent’s scale uniform? Like (1, 1, 1). If so, then it is expected behavior. When you set an object as a child to a non-uniform parent, this will always happen.,Hey, is your parent object’s scale uniform? Like (1, 1, 1)? If not, then it is expected behavior. If you set an object as a child of a non-uniform parent, then this will always happen.

the parent is non uniformly scaled. you should avoid that. if you have to though make the object a child of a parent for both, the scaled and the new object which is not scaled.