Skip to content

Instantly share code, notes, and snippets.

@kazukitanaka0611
Last active March 27, 2018 09:16
Show Gist options
  • Save kazukitanaka0611/dc823682347c82b4eae995c7e81f4ef4 to your computer and use it in GitHub Desktop.
Save kazukitanaka0611/dc823682347c82b4eae995c7e81f4ef4 to your computer and use it in GitHub Desktop.
Unity mouse position to GameObject http://www.lightgive.net/entry/2015/07/14/200502
void FixedUpdate ()
{
Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
mousePos.y = 0.0f;
transform.position = mousePos;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment