A simple solution for mobile portrait scaling in unity.
Also, the script doesn't rly have to be in update() you could just run it in start() if the screen size should stay the same.
Hope this helps :)
IDK if there are any questions to be asked about this but if you have one please ask.