teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

コードコメントを追記

2018/06/10 02:20

投稿

negitama
negitama

スコア943

answer CHANGED
@@ -7,6 +7,7 @@
7
7
 
8
8
  このようにするのが一案です。
9
9
  ```C#
10
+ // 右キーも左キーも押されていなければ、速度をゼロにする
10
11
  if(!isRightPress && !isLeftPress){
11
12
  rb.velocity = Vector3.zero;
12
13
  }

1

修正

2018/06/10 02:19

投稿

negitama
negitama

スコア943

answer CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  このようにするのが一案です。
9
9
  ```C#
10
- if(!isRightPress || !isLeftPress){
10
+ if(!isRightPress && !isLeftPress){
11
11
  rb.velocity = Vector3.zero;
12
12
  }
13
13
  ```