transform.position = new Vector3(0.5f,(Input.mousePosition.y / Screen.height), 3);
I’m using transform.position to move the GUITexture. However, my problem is that whenever I select/click the GUITexture, it moves directly to the mouse position. How can I make it not move when I click it? Please let me know if this is bad explained.
You did not share the rest of your code, so I have to guess a bit. You are likely executing the line of code in your question in OnMouseDrag(). The ‘trick’ is to capture the offset between the mouse and your object when the mouse goes button goes down. If you are using OnMouseDrag(), then do it in OnMouseDown(). If you are using Input.GetMouseButton(), then do it in Input.GetMouseButtonDown(). You calculate the pixel offset from your mouse position to the screen coordinate of your GUI.Texture.