When I use local scale text goes behind everything, how do prevent that?

The first screenshot I don’t use local scale and it’s visible.
The second screen I do use it and the text is now behind the background.

I’m using GUI text. Here’s the code

        if (transform.localScale.x > scaleIncrement.x) {
            Vector2 scale = (scaleIncrement) + (Vector2)transform.localScale;
            transform.localScale = scale;
            //speed += accel;
        }


Maybe by converting the local scale to a vector2, it is setting its z scale to 0, which makes your object invisible.

Try adding back the original z scale.

I guess you’ll have to use a Vector3 value.

The object doesn’t become invisible it just goes into the background