Game behave differently when tested in unity and in android

I am making a top down shooter and already have a basic scene setup which have a player and enemies for testing. I used UI elements to create two virtual joysticks to control the player. I added an image to act as health bar (round shape) which is shown as green on top of the player. Then I added a script “UIPlace” to place the UI image at the same position as of the player. And then I took the health attribute of the player and used it to calculate a value fillAmt which I then used to manipulate the Fill Amount of the Image. When tested on unity everything works well. When built and tested on android the game now behaves differently. The “UIPlace” script was having no effect and the player’s health no longer changes. I did several tests and found that when I comment out the lines calculating and assigning of fillAmt , the player takes damage. Any solution to this problem? Thanks in advance

NB: screenshots of game and a script are attached

So…fixed it myself. In both scripts that were not working properly, I used the GameObject.FindGameObjectWithTag to find required image dynamically in the awake method. Seems like it was causing the problem. Made a public game object, assigned it in the editor and now it works perfectly in android build. But getting it dynamically worked when testing inside Unity.