InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings
문제 내용
Project 를 생성하게 되면 기본적으로 Input System 이 Input Manager 로 설정 되는것을 확인할 수 있다. (2021.3.13f1 Standard 기준)
관련해서 확인해아 하는 부분은 다음과 같다
- Input Manager : [Edit] - [Project Settings] - [Input Manager]
- Active Input Handling* : [Edit] - [Project Settings] - [Player] - [Other Setting] - [Configuration] - [Active Input Handling*]
위의 정보가 기본 설정 값인데
여기서 새로 추가된 Input System Package 라고 Package Manager 에서 설치하게 되면
Input System이 기존의 Input Manager와 Input System으로 두 가지가 되는 상황이고
여기서 Input System Handling 옵션을 어느 하나로 지정했을 경우 충돌이 생기는 현상으로 판단된다.
증상
만약 Active Input Handling* 정보가 다음과 같이
Input System Package (New)로 설정되있다면
Input Manager 정보가 변경되 있다는 것을 확인할 수 있다.
입력 처리가 Input system package로 전환되서 Input manager가 사용되지 않는다는 내용이며
이 상태에서 기존에 사용했던 형태로 Input 기능을 사용하면 해당 Error 가 발생한다.
public class TestInput : MonoBehaviour
{
void Update()
{
if(Input.GetKey(KeyCode.A))
{
Debug.Log("A");
}
}
}
Error 발생
해결 방법
Active Input Handling 값을 Both로 설정 한다.
-> [Edit] - [Project Settings] - [Player] - [Other Setting] - [Configuration] - [Active Input Handling*] - [Both]
참고자료
Installation guide | Input System | 1.0.2
Installation guide This guide describes how to install and activate the Input System package for your Unity Project. Note: The new Input System requires Unity 2019.1+ and the .NET 4 runtime. It doesn't work in projects using the old .NET 3.5 runtime. Insta
docs.unity3d.com
'Unity' 카테고리의 다른 글
[Unity][Error] This feature requires ASM7 See the Console for details. 빌드 에러 이슈 (0) | 2023.04.11 |
---|---|
[Unity][Error] ProjectBrowser.OnGUI.repaint 무한 대기 상태 (0) | 2023.03.08 |
[Unity] 절전 모드 설정 (0) | 2022.02.23 |
[Unity][Error] CommandInvokationFailure: Unity Remote requirements check failed 에러 (0) | 2021.08.11 |
[Unity] Play시 Importing (busy for [time]) Message (0) | 2021.07.16 |