I have some Game Objects that the player can move left and right across the screen. I need for the scale of these objects to be 100% when they are in the center of the screen, and 0% when they are at the edges. And I need a linear curve between the two.
I’m calculating the distance from the center of the screen. I’ve tried using transform.localScale in the Update, but it just adds the scale change on top of the previous scale change, making the object grow (or shrink) infinitely.
Is there a way that I can constantly update the scale of an object compared to its original size, instead of its current size? Or a better way to do this altogether? Working with UnityScript.