Input axis horizontal is not setup ошибка

Arman Arutyunov

I’ve received an error:
ArgumentException: Input Axis Horizantal is not setup. To change the input settings use: Edit -> Project Settings -> Input PlayerMovement.Update () (at Assets/Scripts/PlayerMovement.cs:18)

Have no idea why because I retyped everything pretty accurately in code like hundred times! Maybe anyone could find a mistake?

using UnityEngine;
using System.Collections;

public class PlayerMovement : MonoBehaviour {

    private Animator playerAnimator;
    private float moveHorizontal;
    private float moveVertical;
    private Vector3 movement;

    // Use this for initialization
    void Start () {
        playerAnimator = GetComponent<Animator> ();
    }

    // Update is called once per frame
    void Update () {
        moveHorizontal = Input.GetAxisRaw ("Horizontal");
        moveVertical = Input.GetAxisRaw ("Vertical");

        movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    }

    void FixedUpdate () {
        if (movement != Vector3.zero) {
            playerAnimator.SetFloat ("Speed", 3f);
        } else {
            playerAnimator.SetFloat ("Speed", 0f);
        }
    }
}

1 Answer

Alan Mattanó

PLUS

Hi Arman,
[I’m learning english, my english is not good]
Double click the error and the Mono or Visual Studio editor will open showing you the position with the cursor in where is the error (close to the error). probably it will select the line where is the error.
If it is

          moveHorizontal = Input.GetAxisRaw ("Horizontal");

since moveVertical and Input.GetAxisRaw do not has a red line under it so probably are correct.
There is also a correct line ending («»); probably «Horizontal» is not declare in the Input system or was change.

So double check the Input setup by selecting in the unity toolbar, Edit -> project Settings -> Input and in the Inspector you will find Axes. Expand the list. Here you find all the inputs Name and in this case must be Horizontal (is upper case sensitive).

Sometimes this settings can change when you import assets that change them. More in detail the file containing this list is in the folder «ProjectSettings». There is the file InputManager.asset . If you change this file, it will change all the input settings. When you import an asset that change the files in «ProjectSettings», unity will let you know.

Hope this answer is close to your question. If is not, look if the ‘Animator’ is attached to the game object.

Подскажите как исправить. Анимация персонажа работает, при включении wandering AI Charac, персонаж начинает двигаться автоматически, ходит боком покругу, вперед и опять по кругу. Но из контроля клавишами, откликается только на пробел (прыжок) но на стрелки не откликается.
Выдаётся ошибка в консоли:

ArgumentException: Input Button Sneak is not setup.
To change the input settings use: Edit -> Project Settings -> Input
PlatformCharacterController.Update () (at Assets/Locomotion System Files/Character Controller Scripts/PlatformCharacterController.cs:39)

Но в открывающейся панели Input, не могу понять, что нужно делать…. тут много закладок но Button Sneak нет…

До этого, были ошибки вроде:

ArgumentException: Input Axis Horizontal2 is not setup.
To change the input settings use: Edit -> Project Settings -> Input
AimLookCharacterController.Update () (at Assets/Locomotion System Files/Character Controller Scripts/AimLookCharacterController.cs:23)

Там была ошибка в нащвании опции Horizonta, котоая была укащана без 2.
Но в перечне опций, нет Button Sneak. По этому не знаю, что нужно делать.


Go to Unity3D


r/Unity3D


r/Unity3D

News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.




Members





Online



by

Goats-are-the-best42



It says the input axis Horizontal is not set up


r/Unity3D - It says the input axis Horizontal is not set up

Topic: error need help  (Read 1869 times)

just started playmaker and already getting an error >_<

ArgumentException: Input Axis Horizontal Axis is not setup.
 To change the input settings use: Edit -> Project Settings -> Input
HutongGames.PlayMaker.Actions.GetAxis.DoGetAxis () (at Assets/PlayMaker/Actions/GetAxis.cs:51)
HutongGames.PlayMaker.Actions.GetAxis.OnUpdate () (at Assets/PlayMaker/Actions/GetAxis.cs:46)
HutongGames.PlayMaker.FsmState.OnUpdate ()
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.Fsm.Update ()
PlayMakerFSM.Update ()

trying this out


Logged


ok check by going to  Edit -> Project Settings -> Input and see if Horizontal is set up if it is check spelling of variable of global and the axis name in the fsm variable get axis


Logged


hmm still getting the same error


Logged


Hi,

 it’s case sensitive, so make sure you are both defining the input properly and also referencing it properly in the action itself.

 Bye,

 Jean


Logged


Понравилась статья? Поделить с друзьями:

Не пропустите эти материалы по теме:

  • Яндекс еда ошибка привязки карты
  • Inpa ошибка ifh 0010
  • Inpa ошибка 227
  • Inpa как прочитать ошибки
  • Inpa k dcan ошибка

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии