0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Unityでゲームつくりてえ:マウス関連

Posted at

マウスカーソルの座標を得る

Input.mousePosition

座標をワールド座標に変換

transform.position に収まってるやつがワールド座標。
Camera.main.ScreenToWorldPoint(Input.mousePosition)

ボタン押したかどうか取る

Input.GetMouseButtonDown(0)
Input.GetMouseButtonUp(1)
0は左クリック、1で右クリック、2でホイールクリック。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?