Move an image's Y location with a changing variable

Hi I am still quite new to unity and C# programming but I am creating a game and I would like your help with something.

So I have a variable, like “money”, that will fluctually increase from 20 to 2000 or something along that line.
Now I want to have a background that will scroll along its Y-axis according to the change of the variable: money.
So when money = 20 the object:Y-value = 0 , and when money = 200, object:Y-value = 100, for example.
I have tried some things with transform.position, but could not get it to work.

I hope somebody has an idea on how to do this.

Thanks in advance!

GameObjects are moved in Unity by accessing their attached Transforms.

One of the properties of Transforms is .position (or .localPosition if parented).

You would use your money value, perhaps through a scaling function, and set the position (or localPosition) of the GameObject containing the background.

It sounds like perhaps you need to stop work on this idea and go do several different tutorials first, otherwise you will waste a LOT of your own time with mysterious things.