Unity/Unreal 模拟摇杆追踪

Unity/Unreal Analog Stick Tracking

我想知道 EA 如何设法在 Skate 3 中实现一个系统,在该系统中,您可以通过各种方式轻击正确的模拟摇杆来完成各种技巧。能否在 Unreal Engine 4 或 Unity 中完成,您可以在其中跟踪摇杆的位置并查看它的去向? 谢谢!

好的,我可以在 Unity3D 示例上展示,因为我不了解 UE。

首先,您需要将垫连接到设备,并有一种方法可以打印每个 button/joystick 轴的编号。这就是您如何知道每个按钮或操纵杆的 id/number。

要做到这一点,请检查这个(这也说明了如何编程)(source)。

For gamepad buttons, set up new buttons in the input manager by using "joystick button x" for the positive or negative buttons, where x = the number of the button you want (starting with 0). The Type should be "Key or Mouse Button". To use this in scripting, use Input.GetButton("XX"), where "XX" is the Name of the entry from the input manager.

For gamepad analog sticks, set up new axes in the input manager by using "Joystick Axis" for the Type. The left stick would need two entries in the input manager, one horizontal (using the X axis), and one vertical (using the Y axis). The right stick would need another two, using the 3rd and 4th axes. To use these in scripting, using Input.GetAxis("XX"), where "XX" is again the Name of the entry from the input manager.

在您的情况下,您需要检查操纵杆轴,因为这是来自垫操纵杆的输入的位置。