* Unity 2019.1부터는 새로운 Input System 패키지가 도입되면서,
기존의 Input.GetKey, Input.GetAxis와 같은 Legacy Input API는 기본적으로 차단된다
따라서, 기존 방식을 사용하려면 추가 설정이 반드시 필요하다
🧨 발생했던 에러 메시지
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.
UnityEngine.Input.GetKey (UnityEngine.KeyCode key) (at <1bcf3db9368d4289aae60d04194b7157>:0)
PlayerController.Update () (at Assets/Script/Managers/PlayerController.cs:15)
🔍 원인
아래와 같이 설정되어 있는 경우, Input.GetKey와 같은 기존 Input 클래스를 사용하면 오류가 발생한다
Edit > Project Settings... > Player > Active Input Handling > Input System Package (New)
✅ 해결 방법
Edit > Project Settings... > Player > Active Input Handling > Both로 변경
'업무_메모' 카테고리의 다른 글
[Unity] 전역 매니저 만들기 (0) | 2025.04.15 |
---|---|
Visual Studio에서 C# IL 코드 보는 방법 정리 (0) | 2025.04.09 |
스택 풀기: 예외가 발생한 위치를 제대로 추적하려면 (0) | 2025.04.01 |
비주얼 스튜디오 파워모드 플러그인 설치 (0) | 2024.11.20 |
윈도우에서 다운 받은 파일 체크섬 확인하기 (0) | 2024.11.11 |