I'm managing a dynamic UI based on canvas. The UI is created with Layout groups (vertical and horizontal).
One of the dynamic components of this UI is a prefab that I'm instantiating, filling with the needed information, and attaching to the parent that will dynamically place it through a vertical layout.
I can't understand why this instance is attached and rescaled to "0.683". To make it work correctly I have to scale it back to 1 from code. This behaviour since pretty strange... I'm wondering if you have suggestions to avoid the need to resize the object from code. Even if it is not such a problem I rather keep this flow clean.
Note: If I attach the same object manually from the editor, the behaviour is correct and the item is keeping a scale of 1.
If you Instantiate prefab the newly created instance will have the same scale as prefab, but if you change parent of that object to object that is scalled your instantiated prefab will change localScale to keep the same size. If you are talking about UI you probably have "CanvasScaller" component on the Root object in your hierarchy that provides scalling for UI. So basicaly
You should probably use one of the Instantiate overrides that takes Transform parent as one of the arguments so you don't need to change it later.