対象書籍
Unityの教科書 Unity 6完全対応版 Unity 6.1より、マウスのクリックなどを取得するInput Systemの設定が変更されております。
サンプルファイルを実行した際に次のようなエラーが表示された場合は、手順に従って設定を行ってください。
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.
①メニューバーから「File→Build Profiles」を選択してBuild Profilesウィンドウを開き、右上の「Player Settings」をクリックしてください。
②Other Settingsの「Active Input Handling」を「Both」に変更してください。
③「Unity editor restart required」というポップアップが表示されたら、「Apply」をクリックしてUnityを再起動してください。