GUI Texture didn't work well.

function Update () {
transform.position=Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x,Input.mousePosition.y,9));
}

I dragged this script to a Cube and a GUI Texture,only the Cube followed my mouse,and the GUI Texture didn’t work well. Why?

Thanks in advanced.

The transforms of the GUITextures are not in 3D space, but in 2D (Your screen). The values in a GUITexture transform.position are in the inclusive[0,1] range, as percentages of your screen. [0,0] is the bottom left corner, [1,1] is the top right.

You will need different moving logic to be able to move your GUITexture around on the screen. Basically, you need to divide the current mouse position on the screen by the screen width or height; mousePosition.x by width and mousePosition.y by height.