Prefab UI Scaling with game build issue

Hi, I have just built a prototype for my game as is common practice and in the build, I have a weird issue that the prefabs that are being built in runtime (of which they are scaled with a “Vertical Layout Component”) are scaling to big (as in too wide and too high). To add in “game mode” (editor), the UI scales just fine in a set aspect resolution and at a set resolution. How can this be fixed?

Make sure you have properly added a Canvas Scaler component for your canvas that suit your needs, if you did please provide some prints on the vertical layout component and your general hierarchy so we can provide a better answer.

Example on canvas scaler:
187620-capture.png

Ok, so long story short it was an issue with the scaler, however, it was a problem on each prefab. It would scale it to 1.576… on every axis. So I solved this by manually setting the prefabs scale.

prefabName.transform.localScale = new Vector3(1, 1, 1);

I am curious. Prior to setting your transform.localScale, what values are in there?

I am guessing 1.576 from what you said in your answer, so I am wondering where it gets that value from.