Demo05-Fixbug运行报错,要使用新的Input System报错内容:InvalidOperationException: You are trying to read Input usin...
Demo05-Fixbug运行报错,要使用新的Input System
报错内容:InvalidOperationException: You are trying to read Input using the UnityEngine.
PlayerControllerX.cs文件需要修改成以下代码
void Update(){
if (Keyboard.current != null && Keyboard.current.spaceKey.wasPressedThisFrame){
Instantiate(dogPrefab, transform.position, dogPrefab.transform.rotation);
}
}