Shrink gameobject when its local scale is half of screen width

Hey guys how do I shrink a gameobject when its transform is half of the screen width thanks

Just put in some test values in the local scale to see after which value you want to shrink it down and then you can check if that value is reached or not. if yes then you can shrink by decreasing the local scale bit by bit in the update and stop after a certain value if you intend to