re: why it's not working in the browser? i found it to be a bug in Unity - using transform.position for a GameObject that uses RectTransform instead renders that GO invisible in the WebGL build for some weird reason :(
why you asking me?