LoginSignup
1
1

More than 3 years have passed since last update.

(基礎 1-1)UnityでのC# のお作法 ~Input~

Posted at

入力値のコードとしてinput

sample1.cs
Input.GetAxis("Horizontal");

上記は -1 ~ 1 nの間の不動小数点で入力値が取得できる
(Horizontalなので左右の水平方向の数値)

sample2.cs
Input.GetAxisRaw("Vertical");

上記の記入方法だと-1または1のせい数値のみが取得できる値となる
(こちらはVerticalなので上下の垂直方向の数値)

※初めての投稿なのでこんな感じでまずはやってみました

1
1
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
1
1