Unity GUI Button Error

I made a game useing GUI Buttons like this

if(GUI.Button(Rect(halfScreenW, Screen.height, buttonW, buttonH), "Hallway")){
//code here

The buttons work perfectly in the Unity application – When I click the play on the top, the game plays smoothly.

However after I build it for the web, the buttons fail to work in chrome specifically. Its extremely weird too. When I open and close my in-browser chrome console it works but not on the first load. I am very confused.

provide value of all your variable you are using. if you are using negative value for buttonH, then it may not work. if you are using positive value for buttonH, then this button would be out of screen. so it will never get clicked.