C# ```### 前提・実現したいこと Unity初心者で簡単なブロック崩しゲームを作っています。プレイヤーを左右に動かすスクリプトを書いてエラーが出ました。調べてもよく分からなかったので、アドバイス頂ければ幸いです。 ### 発生している問題・エラーメッセージ
Assets\game\player.cs(23,19): error CS0117: 'Input' does not contain a definition for 'Getkey'
Assets\game\player.cs(26,22): error CS1061: 'player' does not contain a definition for 'transrorm' and no accessible extension method 'transrorm' accepting a first argument of type 'player' could be found (are you missing a using directive or an assembly reference?)
### 該当のソースコード ```ここに言語名を入力 public class player : MonoBehaviour { public float speed = 1.0f; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.Getkey(KeyCode.LeftArrow)) { if (this.transform.position.x > -4) this.transrorm.position += Vector3.left * speed * Time.deltaTime; } if (Input.Getkey(KeyCode.RightArrow)) { if (this.transform.position.x < 4) this.transrorm.position += Vector3.right * speed * Time.deltaTime; } } }
試したこと
参考の動画と何度も見比べたのでコード自体は間違っていないと思います。しかし、InputやVevtor3やTime、KeyCodeの予測が出てこず、色も変わりません。Visual Studioの設定に問題でもあるのでしょうか?
補足情報(FW/ツールのバージョンなど)
2020.3.7.f1 visual studio 2019
ここにより詳細な情報を記載してください。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/06/18 08:46