Unity 2021.3.23f1+Hololens2+Vuforia远程调试仅显示Webcam流求助
使用Unity 2021.3.23f1及最新版Vuforia Engine,通过MRTK场景功能与Vuforia Behaviour脚本配置相机设置后,在Play模式下借助Remoting App运行时仅显示Webcam流。World Center Mode已设置为"Device",但在脚本设置中未找到选择Hololens的选项。项目在Visual Studio中构建并运行时一切正常,但频繁开发内容时这种情况会浪费大量时间,求解决方案。
相机设置截图:
项目资源截图:
切换目标平台并刷新配置
先切换到UWP平台:File > Build Settings > Universal Windows Platform,将目标设备设为Hololens 2,点击Switch Platform完成后重启Unity。此时脚本Inspector中的Hololens相关选项应该会显示,因为Unity会加载对应平台的配置。配置Vuforia Play Mode为远程设备
打开Window > Vuforia Configuration,在Play Mode区域将Camera Device设置为Remote Device(若存在该选项),确保Vuforia优先使用Hololens通过Remoting传输的相机流,而非本地Webcam。整合Vuforia与MRTK相机系统
- 确保Vuforia Camera对象是MRTK
Camera Rig的子物体,或者在MRTK配置文件(如DefaultMixedRealityToolkitConfigurationProfile)的AR Settings中,将AR Provider设置为Vuforia。 - 检查Vuforia Behaviour组件的
World Center Mode为Device后,关联MRTK的Camera Rig作为跟踪目标,保证空间坐标与Hololens同步。
- 确保Vuforia Camera对象是MRTK
重置MRTK Remoting配置
进入Project Settings > MRTK > Input > Remoting,确认Remote Target Device选择Hololens 2,并启动Remoting服务。同时在Hololens上的Remoting App中连接到Unity编辑器的IP地址。验证版本兼容性
确认使用的Vuforia Engine版本与Unity 2021.3.23f1、MRTK版本(建议MRTK 2.8.x或适配2021.3的版本)兼容。可参考Vuforia官方兼容文档,避免因版本不匹配导致的功能缺失。
内容的提问来源于stack exchange,提问作者Morteza Dianatfar

