D
D
Denis Fedotov2020-06-02 15:27:38
Unity
Denis Fedotov, 2020-06-02 15:27:38

How to fix the error: The name "imput" is not present in the current context?

here is the code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PleyerControl : MonoBehaviour {
  public float speed = 20f;
  private Rigidbody2D rb;

  void Start () {
    rb = GetComponent <Rigidbody2D> ();
  }
  
   void Update () {
    float moveX = Imput.GetAxis ("Horizontal");
    rb.MovePosition (rb.position + Vector2.right * moveX * Time.deltaTime);
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-06-02
@denis_fedotov

Typo:
float moveX = I m put.GetAxis("Horizontal");
Imput - there is no such thing, but there is Input)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question