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

Unity Discussions

Loading

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.

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.

Перейти к контенту

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.

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.

if (Input.GetButtonDown("w"))
    {
        gb.transform.position = Vector3.forward * Time.deltaTime;
    };

    if (Input.GetKeyDown("s"))
    {
        gb.transform.position = -Vector3.forward * Time.deltaTime;
    };

fd64c0c4a49847acbc415c6b8436b31b.JPG

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

Необычный инди-хоррор.

GoldHobbit Дата: Вторник, 21 Января 2014, 14:27 | Сообщение # 21

частый гость

Сейчас нет на сайте

Ну… Мне нравится роман «Метро 2033» и «Метро 2034». У него необычные книги и многим нравится. Как говорится каждому своё. И ещё я крайне уважаю вас, но я далеко не серая масса. У меня много идей и я вполне позитивный человек. Не хочу гордится этим, но я не люблю мат и не употребляю его в речи… Некоторые люди любят пострелять и плевать на сюжет… А я например другого мнения. Сюжет это важная часть игры… Поэтому я и развиваюсь во всех направлениях. Мне создавать игру кажется интереснее, чем играть в неё… Я выделяюсь из серой массы. Я общительный и вполне адекватный smile . В наше время молодёжь употребляет мат на каждом шагу…

Добавлено (21.01.2014, 14:27)
———————————————
Люди вопрос! Проблема с фонариком. Сделал всё по инструкции, скачал скрипт. Но теперь когда я включаю игру, не могу двигаться. И такая ошибка: unity explosion input axis mouse x is not setup


Интернет — страна чудес: вошёл в него и в нём исчез…

Сообщение отредактировал GoldHobbitВторник, 21 Января 2014, 13:30

Nasa13 Дата: Вторник, 21 Января 2014, 14:53 | Сообщение # 22

заслуженный участник

Сейчас нет на сайте

This error means that you’re using an axis not set up in the Input manager. Usually this happens when you try to read a non-existent axis, or an axis with a misspelled name, like `Input.GetAxis(«horizontal»)` (it should be «Horizontal») or `Input.GetAxis(«ScrollWheel»)` (should be «Mouse ScrollWheel»).
Find the line where the error occurs and check the axis name. If it seems ok, verify the axis settings in the Input Manager (menu Edit/Project Settings/Input)

Вот ответ!)

Если не очень знаешь анг, я постараюсь перевести

Такая ошибка случается, когда ты используешь Axis которая не установлена(не прописана) в Input manager.Обычно это случается ,когда ты пытаешься «прочитать несуществующую Axis», или когда Axis написано неправильно, как `Input.GetAxis(«horizontal»)` (а должно быть — «Horizontal») или `Input.GetAxis(«ScrollWheel»)` (а должно быть «Mouse ScrollWheel»).

Найди линию(строчку), на которой ты допустил ошибку, и проверь правильность написание Axis. Если все в порядке, проверь Axis в Input Manager (menu Edit/Project Settings/Input)


все люди одинаково полезны,говорил людоед туристам.

Мешает грудь? Спячь под «СПОЙЛЕР.*)

моя мини демка ,хоррор http://3drad-alec.ucoz.com/forum/6-39-1

GoldHobbit Дата: Вторник, 21 Января 2014, 14:59 | Сообщение # 23

частый гость

Сейчас нет на сайте

Честно говоря я новичок. Можете дать сслыку на понятный урок по фонарику, моя версия Unity, четвёртая.


Интернет — страна чудес: вошёл в него и в нём исчез…

Nasa13 Дата: Вторник, 21 Января 2014, 15:04 | Сообщение # 24

заслуженный участник

Сейчас нет на сайте

Честно, я вообще не знаю, что за фонарик вам нужен! =)

Я бы мог написать урок за одну минуту, потому как смысл в том ,чтобы просто :

1) Добавить на сцену Point Light
2) Указать в настройках Spot light (либо сразу добавить его)
3)Навести в эдиторе на него мышкой(на объект)
4)Зажать мышку (и вы сможете его двигать, как бы перемешать)
5) Поместить Прям на Игрока,(на камеру) и он как бы станет дочерним объектом, и будет меняться локация/ориентация в зависимости от Положения игрока=)

Конец…ну это примерно так…


все люди одинаково полезны,говорил людоед туристам.

Мешает грудь? Спячь под «СПОЙЛЕР.*)

моя мини демка ,хоррор http://3drad-alec.ucoz.com/forum/6-39-1

Сообщение отредактировал Nasa13Вторник, 21 Января 2014, 15:05

GoldHobbit Дата: Среда, 22 Января 2014, 13:17 | Сообщение # 25

частый гость

Сейчас нет на сайте

Что делать! После попытки установки фонарика (Туториал на ютубе) Там надо было изменить что-то в настройках Project Settings — Input, я изменил… Всё персонаж (от первого лица) не двигается вообще. Что не так то?

Добавлено (22.01.2014, 13:17)
———————————————
Всё разобрался. Скоро будет геймплейный ролик.


Интернет — страна чудес: вошёл в него и в нём исчез…

allods Дата: Среда, 22 Января 2014, 13:52 | Сообщение # 26

почти ветеран

Сейчас нет на сайте

Цитата GoldHobbit ()

Всё разобрался. Скоро будет геймплейный ролик.

Если в твоей игре стандартный контроллер и только одна способность включать и выключать фонарик то воздержись от роликов с геймплеем, так как каждый второй выкладывает свою личинку на ютуб где только и можно бегать да включать фонарик.

GoldHobbit Дата: Четверг, 23 Января 2014, 14:02 | Сообщение # 27

частый гость

Сейчас нет на сайте

Воу, воу, полегче, я же не только фонарик запилю, это вполне серьёзный проект.

Добавлено (23.01.2014, 13:16)
———————————————
Хотел спросить одну вещь, модельки я качал. И там текстуры разные, мне сказали что текстуры надо в свой проект в папку с текстурами засовывать, но есть одно но. После того как я попытался найти папку с текстурами, их там около десяти папок «Textures». Не знаю куда теперь их кидать. Подскажите!

Добавлено (23.01.2014, 14:02)
———————————————
Так, всё окей, разобрался.


Интернет — страна чудес: вошёл в него и в нём исчез…

Сообщение отредактировал GoldHobbitЧетверг, 23 Января 2014, 13:18

Успех!

Благодарим вас за то, что вы помогаете нам улучшить качество документации по 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);
}
}
63f5d2e6e370d207318881.png63f5d32e30121303914313.png63f5d34eb15fd140057436.png


  • Вопрос задан

    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);
}
}
63f5d2e6e370d207318881.png63f5d32e30121303914313.png63f5d34eb15fd140057436.png


  • Вопрос задан

  • 58 просмотров

В переводчик что ли фарзу забить не можете? у вас ось horizontal не настроена. Сделайте то что написано в ошибке (там прям инструкция), или используйте ту ось которая есть.

Пригласить эксперта


  • Показать ещё
    Загружается…

21 сент. 2023, в 14:51

30000 руб./за проект

21 сент. 2023, в 14:49

25000 руб./за проект

21 сент. 2023, в 14:33

5000 руб./за проект

Минуточку внимания

Понравилась статья? Поделить с друзьями:
  • Input aux 2 пежо 308 ошибка
  • Inpa ошибки на русском
  • Innovert ошибка ос1
  • Inpa ошибка ifh 0010
  • Initial start ошибка ниссан