I have a mouse drag function to move an object to where the mouse are, and works fine, but when i put into an gameObject it simply doesn’t work. Sorry for my english, i dont’t write so well…
void OnMouseDrag() {
transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10));
}