如何在分屏游戏中使用Unity的新输入系统

时间:2020-07-06 11:08:44

标签: c# unity3d

我试图了解Unity的新输入系统并将其用于分屏游戏。

现在我遇到了多个问题:
键盘控制方案只能将播放器移动一帧,而控制器可以在其他播放器上正常工作。

因此,我决定遵循youtube上的一些教程,并解决了该问题。但是现在,两个播放器都收听两个输入设备(控制器和键盘)。我现在很困惑。

This is the input action asset I am using. The WASD keys are all set to the Keyboard scheme and the controller input action is set to the Controller scheme.

This is the script for moving the player where I collect the movement value and apply it to the player.

I am using the InputManager to spawn the players, but since automatic spawning didn't work I tried the manual spawing option using this script to manually spawn the players. And as you can see I specify the Control scheme and the assigned devices for both player instances

And finally this is the player prefab that will be spawned using the spawning script above

我希望有人可以帮助我:D

谢谢!

0 个答案:

没有答案