0
void Start()
{
    rb = GetComponent<Rigidbody2D>();

}

void Update()
{
    if (Input.GetKey(Keyboard.W)) transform.Translate(0, 1, 0);
    speedX = -horizontalSpeed;

}

Ошибка:

The name 'Keyboard' does not exist in the current context.

1 ответ 1

1

Замените Input.GetKey(Keyboard.W) на Input.GetKey(KeyCode.W).

2
  • Спасибо, а почему он вверх не идет?? 12 июл 2019 в 20:18
  • @IvanBrazhnik это уже другой вопрос (: 12 июл 2019 в 20:24

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.