Weird transform behaviour

Hello,
Whenever I try to use the code shown below to move up, it doesn’t add 0.005f to the X value of the object. Instead, it goes from it’s instantiated position (-0.055f) to -0.05486955. Why does this happen? I tried adding 0.005f to the current location but it does the same… Thanks!

void Move() {
            if (Input.GetKeyDown(KeyCode.UpArrow) && transform.position.y < 0.050f) {
                transform.rotation = Quaternion.identity;
                transform.Translate(0, 0.005f, 0);
            }
}

Looks like you need to check for input in update function like this

         void Update() {
                     if (Input.GetKeyDown(KeyCode.UpArrow) && transform.position.y < 0.050f) {
                         transform.rotation = Quaternion.identity;
                         transform.localPosition = new Vector3 (   transform.localPosition.x,    transform.localPosition.y + 0.005f,   transform.localPosition.z);
                
                     }
         }