Last active
March 27, 2018 09:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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