Loading
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
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.
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
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.
Перейти к контенту
Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
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
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.
if (Input.GetButtonDown("w"))
{
gb.transform.position = Vector3.forward * Time.deltaTime;
};
if (Input.GetKeyDown("s"))
{
gb.transform.position = -Vector3.forward * Time.deltaTime;
};
ArgumentException: Input Button w is not setup. To change the input settings use: Edit -> Project Settings -> Input CubeScript.Update () (at Assets/scripts/CubeScript.cs:14)
но ведь в инспекторе они назначены?
-
Вопрос заданболее трёх лет назад
-
2454 просмотра
Если я правильно помню:
У вас назначена клавиша Horizontal, к которой прибинджены w и s. Вам нужно завести еще две клавиши — вот там вверху size поменять на 3, назвать их соответствующее w и s (хотя названия можно давать любые), и тогда все заработает.
На скриншоте оси, в которых заданы клавиши. Чтобы проверять оси нужно использовать Input.GetAxis(«Horizontal»), возвращает значение типа float, которое представляет собой «направление» нажатия, то есть: положительное — D/RightArrow, отрицательное — A/LeftArro
Другой вариант: использовать Input.GetKey(KeyCode code), тогда не придется настраивать оси и можно отслеживать клавиши клавиатуры.
Пригласить эксперта
-
Показать ещё
Загружается…
09 февр. 2023, в 23:00
1500 руб./за проект
09 февр. 2023, в 22:06
500 руб./за проект
09 февр. 2023, в 22:01
50000 руб./за проект
Минуточку внимания
XRTK — Mixed Reality Toolkit Bug Report
Describe the bug
On Play, this error is logged every frame
Input Axis is not setup.
To change the input settings use: Edit -> Settings -> Input
at (wrapper managed-to-native) UnityEngine.Input.GetAxisRaw(string)
at XRTK.Providers.Controllers.UnityInput.GenericJoystickController.UpdateButtonData (XRTK.Definitions.Devices.MixedRealityInteractionMapping interactionMapping) [0x00052] in D:MTemplateXRTKTemplate9LibraryPackageCachecom.xrtk.core@0.1.19ProvidersControllersUnityInputGenericJoystickController.cs:92
at XRTK.Providers.Controllers.UnityInput.GenericJoystickController.UpdateController () [0x00086] in D:MTemplateXRTKTemplate9LibraryPackageCachecom.xrtk.core@0.1.19ProvidersControllersUnityInputGenericJoystickController.cs:57
at XRTK.Providers.Controllers.OpenVR.GenericOpenVRController.UpdateController () [0x0007e] in D:MTemplateXRTKTemplate9LibraryPackageCachecom.xrtk.core@0.1.19ProvidersControllersOpenVRGenericOpenVRController.cs:164
at XRTK.Providers.Controllers.UnityInput.UnityJoystickDataProvider.Update () [0x00059] in D:MTemplateXRTKTemplate9LibraryPackageCachecom.xrtk.core@0.1.19ProvidersControllersUnityInputUnityJoystickDataProvider.cs:54
at XRTK.Services.MixedRealityToolkit.UpdateAllServices () [0x00095] in D:MTemplateXRTKTemplate9LibraryPackageCachecom.xrtk.core@0.1.19ServicesMixedRealityToolkit.cs:1284
UnityEngine.Debug:LogError(Object)
XRTK.Services.MixedRealityToolkit:UpdateAllServices() (at Library/PackageCache/com.xrtk.core@0.1.19/Services/MixedRealityToolkit.cs:1288)
XRTK.Services.MixedRealityToolkit:Update() (at Library/PackageCache/com.xrtk.core@0.1.19/Services/MixedRealityToolkit.cs:705)
To Reproduce
Open Unity Hub
New Project with 2019.1.14f1
Choose 3D
Modify the manifest per notes https://github.com/XRTK/XRTK-Core/releases/tag/0.1.19
Includes «com.xrtk.core»: «0.1.19», «com.xrtk.sdk»: «0.1.13», «com.xrtk.wmr»: «0.1.5»,
Add scene to Build
Restart Unity
Click Configure (crash)
Reopen unity and Click Configure
Press Play
Your Setup (please complete the following information)
- Unity Version [e.g. 2019.1.14f1]
- XRTK Version
«com.xrtk.core»: «0.1.19», «com.xrtk.sdk»: «0.1.13», «com.xrtk.wmr»: «0.1.5»,
Target Platform (please complete the following information)
- OpenVR
Additional context
HP Windows Mixed Reality Headset
Необычный инди-хоррор. |
||||||
|
||||||
|
||||||
|
||||||
|
||||||
|
||||||
|
||||||
|
Успех!
Благодарим вас за то, что вы помогаете нам улучшить качество документации по Unity. Однако, мы не можем принять любой перевод. Мы проверяем каждый предложенный вами вариант перевода и принимаем его только если он соответствует оригиналу.
Ошибка внесения изменений
По определённым причинам предложенный вами перевод не может быть принят. Пожалуйста попробуйте снова через пару минут. И выражаем вам свою благодарность за то, что вы уделяете время, чтобы улучшить документацию по Unity.
Параметры
Описание
Возвращает значение по axisName виртуальной оси.
Для ввода с клавиатуры или джойстика значение будет лежать в диапазоне -1. 1. If the axis is setup to be delta mouse movement, the mouse delta is multiplied by the axis sensitivity and the range is not -1. 1.
Это не зависит от частоты кадров. При использовании данного значения нет необходимости беспокоиться об изменении частоты кадров.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerCam : MonoBehaviour
<
public float mouseX;
// Use this for initialization
void Start()
<
Estou tentando seguir o tutorial do jogo «Nightmare» do canal jogando com nils, meu script não apresenta nenhum erro, porém meu personagem não se move e a Unity 5 mostra esse erro relacionado ao axis horizontal. Conferi o vídeo do Nils e ele não altera nada no Axis , só mostra. Assim não consigo mover meu personagem e ele entra na animação Idle. agradeço desde já. segue a baixo o erro apresentado pela Unity 5
ArgumentException: Input Axis horizontal is not setup. To change the input settings use: Edit -> Project Settings -> Input PlayerMovement.FixedUpdate () (at Assets/Scripts/Player/PlayerMovement.cs:37)
segue o código PlayerMovement.cs
segue foto do input Horizontal que está sendo relatado no erro
Continuei seguindo o tutorial e tudo está dando certo exceto pelo fato de que não consigo me movimentar e nem o mouse é seguido, porém agora o console mostra um erro na linha 56 que é esta aqui:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControler : MonoBehaviour
{
public float Speed;
private Vector2 direction;
private Rigidbody2D rb;
void Start()
{
rb = GetComponent();
}
void Update()
{
direction.x = Input.GetAxisRaw(«horizontal»);
direction.y = Input.GetAxisRaw(«Vertical»);
}
void FixedUpdate()
{
rb.MovePosition(rb.position + direction * Speed * Time.fixedDeltaTime);
}
}
-
Вопрос задан22 февр.
-
44 просмотра
В переводчик что ли фарзу забить не можете? у вас ось horizontal не настроена. Сделайте то что написано в ошибке (там прям инструкция), или используйте ту ось которая есть.
Пригласить эксперта
-
Показать ещё
Загружается…
22 июн. 2023, в 00:59
8000 руб./за проект
22 июн. 2023, в 00:56
8000 руб./за проект
22 июн. 2023, в 00:39
12000 руб./за проект
Минуточку внимания
An error “ArgumentException: Input Axis Joystick Look Horizontal is not setup.” occurred when Play button clicked.
Some people have the similar problem as I have.
ArgumentException: Input Axis Joystick Look Horizontal is not setup.
Error: Input Axis Not Set Up
It’s easy to solve. Put “<SteamLibrary>steamappscommonHuman Fall FlatWorkshopPackageProjectSettings” into <UnityProjects><Project directory>.
The following is the detail of this problem.
Problem
I followed the guide to start creating workshop of Human Fall Flat in Unity. When I start “Play” mode, I couldn’t control the Human and he was twisted!!
The following is the detail of the error.
ArgumentException: Input Axis Joystick Look Horizontal is not setup. To change the input settings use: Edit -> Project Settings -> Input HumanControls.get_calc_joyLook () HumanControls.ReadInput (System.Single& walkForward, System.Single& walkRight, System.Single& cameraPitch, System.Single& cameraYaw, System.Single& leftExtend, System.Single& rightExtend, System.Boolean& jump, System.Boolean& playDead, System.Boolean& shooting) Multiplayer.NetPlayer.PreFixedUpdate () Multiplayer.NetGame.PreFixedUpdate () Multiplayer.NetGamePre.FixedUpdate ()
Cause
“Input Axis <NAME> is not setup.” means that the input axis named “NAME” is not defined in Input Manager. Click “Edit” > “Project Settings” > “Input” and check the list of input axis. There is no axis named “Joystick Look Horizontal”.
The project settings, including the “Input Axis”, are defined in the “ProjectSettings” directory in steamapps. Therefore, you need to place this ProjectSettings directory in your own project directory. In my case, I placed a wrong one.
Solution
Close unity project. And put the “ProjectSettings” into the project directory.
Result
You can control the character with no error.
Подскажите как исправить. Анимация персонажа работает, при включении 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. По этому не знаю, что нужно делать.
An error “ArgumentException: Input Axis Joystick Look Horizontal is not setup.” occurred when Play button clicked.
Some people have the similar problem as I have.
ArgumentException: Input Axis Joystick Look Horizontal is not setup.
Error: Input Axis Not Set Up
It’s easy to solve. Put “<SteamLibrary>\steamapps\common\Human Fall Flat\WorkshopPackage\ProjectSettings” into <UnityProjects>\<Project directory>.
The following is the detail of this problem.
Problem
I followed the guide to start creating workshop of Human Fall Flat in Unity. When I start “Play” mode, I couldn’t control the Human and he was twisted!!
The following is the detail of the error.
ArgumentException: Input Axis Joystick Look Horizontal is not setup. To change the input settings use: Edit -> Project Settings -> Input HumanControls.get_calc_joyLook () HumanControls.ReadInput (System.Single& walkForward, System.Single& walkRight, System.Single& cameraPitch, System.Single& cameraYaw, System.Single& leftExtend, System.Single& rightExtend, System.Boolean& jump, System.Boolean& playDead, System.Boolean& shooting) Multiplayer.NetPlayer.PreFixedUpdate () Multiplayer.NetGame.PreFixedUpdate () Multiplayer.NetGamePre.FixedUpdate ()
Cause
“Input Axis <NAME> is not setup.” means that the input axis named “NAME” is not defined in Input Manager. Click “Edit” > “Project Settings” > “Input” and check the list of input axis. There is no axis named “Joystick Look Horizontal”.
The project settings, including the “Input Axis”, are defined in the “ProjectSettings” directory in steamapps. Therefore, you need to place this ProjectSettings directory in your own project directory. In my case, I placed a wrong one.
Solution
Close unity project. And put the “ProjectSettings” into the project directory.
Result
You can control the character with no error.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerControler : MonoBehaviour
{
public float Speed;
private Vector2 direction;
private Rigidbody2D rb;
void Start()
{
rb = GetComponent();
}
void Update()
{
direction.x = Input.GetAxisRaw(«horizontal»);
direction.y = Input.GetAxisRaw(«Vertical»);
}
void FixedUpdate()
{
rb.MovePosition(rb.position + direction * Speed * Time.fixedDeltaTime);
}
}
-
Вопрос задан
-
58 просмотров
В переводчик что ли фарзу забить не можете? у вас ось horizontal не настроена. Сделайте то что написано в ошибке (там прям инструкция), или используйте ту ось которая есть.
Пригласить эксперта
-
Показать ещё
Загружается…
21 сент. 2023, в 14:51
30000 руб./за проект
21 сент. 2023, в 14:49
25000 руб./за проект
21 сент. 2023, в 14:33
5000 руб./за проект