I have a meter that updates when a button is pushed, but I can't get it to update properly.
The method I am using is to grab the transform component of the UISprite object in the
scene and adjust its Y value like this:
public void UpdateMeter() {
_meterTransform.Translate(0,_game.approval,0);
}
the _game variable is a reference to the Game script which contains the approval rating.
The meter should adjust its height according to the value stored there. However, when
I update the meter by pressing the button, the Y component of the transform jumps
90,182 units and I don't know why. The puzzling thing is that the approval rating
is 268 and the starting Y position of the sprite is -161. So basically, the meter
should jump to around 268 when the button is pressed. The approval rating is
updating properly (by about 3 - 9) with every button press, but the Y value
goes crazy. Can anyone help me with this please?