首页 > 解决方案 > Unity Leap Motion 错误消息“输入轴未设置”

问题描述

我目前正在使用 Leap Motion、HTC Vive 和 Unity 进行我的第一个 VR 项目。当我创建一个新项目并添加 LeapRig 时,一切都很好,但是在将交互管理器添加为 LeapRig 的子项后,我收到以下错误消息,该消息每秒重复多次:

INPUT AXIS NOT SET UP.  Go to your Input Manager and add a definition for  on the 9th Joystick Axis.
UnityEngine.Debug:LogError(Object)
Leap.Unity.Interaction.InteractionXRController:fixedUpdateGraspButtonState(Boolean) (at Assets/LeapMotion/Modules/InteractionEngine/Scripts/InteractionXRController.cs:733)
Leap.Unity.Interaction.InteractionXRController:fixedUpdateGraspingState() (at Assets/LeapMotion/Modules/InteractionEngine/Scripts/InteractionXRController.cs:706)
Leap.Unity.Interaction.InteractionController:fixedUpdateGrasping() (at Assets/LeapMotion/Modules/InteractionEngine/Scripts/InteractionController.cs:1783)
Leap.Unity.Interaction.InteractionController:Leap.Unity.Interaction.IInternalInteractionController.FixedUpdateController() (at Assets/LeapMotion/Modules/InteractionEngine/Scripts/InteractionController.cs:259)
Leap.Unity.Interaction.InteractionManager:fixedUpdateInteractionControllers() (at Assets/LeapMotion/Modules/InteractionEngine/Scripts/InteractionManager.cs:372)
Leap.Unity.Interaction.InteractionManager:FixedUpdate() (at Assets/LeapMotion/Modules/InteractionEngine/Scripts/InteractionManager.cs:299)

有谁知道为什么会发生这种情况以及如何解决它?我已经与交互管理器合作过,但突然出现此错误消息。我也可以很好地运行我的程序,但是这个错误仍然困扰着我,并且很难正确使用控制台。

来自德国的问候

马克

标签: unity3dvirtual-realityleap-motion

解决方案


来自交互引擎文档:

如果您打算将交互引擎与 Oculus Touch 或 Vive 控制器一起使用,则需要先配置项目的输入设置,然后才能使用控制器抓取对象。输入设置是无法通过导入的包更改的项目设置,这就是我们无法为您配置这些输入设置的原因。如果您只对使用 Leap 手和交互引擎感兴趣,可以跳过本节。

转到您的输入管理器(编辑 -> 项目设置 -> 输入)并设置您想要用于左手和右手抓握的操纵杆轴。(控制器触发器在 Unity 中仍称为“操纵杆”。)然后确保每个 InteractionXRController 的抓取轴设置为您设置的相应轴。左右 InteractionXRControllers 的默认预制件将分别查找名为 LeftXRTriggerAxis 和 RightXRTriggerAxis 的轴。

有用的图表和轴标签可以在 Unity 的文档中找到。


推荐阅读