一、在上一节的VRPawnBase中,再添加2个Motion Controller,分别命名为:LeftMotionController、RightMotionController,分别代表左右手柄。

  [UE4]添加手柄 [UE4]添加手柄 [UE4]添加手柄

  设置Motion Controller的Hand属性,表示左右手柄:LeftMotionController.Hand=Left、RightMotionController.Hand=Right。

  [UE4]添加手柄

二、MotionController只是一个控制器,没有实体,分别选中LeftMotionController和RightMotionController添加一个Mesh(Static Mesh、Skeletal Mesh、ChildActor都可以,本例使用Static Mesh)作为子节点,分别命名为:LeftHandMesh、RightHandMesh。

  [UE4]添加手柄 [UE4]添加手柄

 三、设置LeftHandMesh.Static Mesh = VivePreControllerMesh,RightHandMesh.Static Mesh = VivePreControllerMesh。

  [UE4]添加手柄

  VivePreControllerMesh是引擎自带的一个手柄模型,如果没有找到,则勾选View Options.Show Engine Content(显示引擎资源),就能找到VivePreControllerMesh了。

  [UE4]添加手柄

 四、运行游戏,在现实中拿着左右2个手柄左右晃动,可以看到游戏场景里面的手柄也会跟着左右晃动。把现实中的2个手柄放在地上,如果游戏场景里面的手柄也跟着放在地上,则表示高度设置没问题。  

  [UE4]添加手柄

  如果高度不正确的话,检查VRPawnBase里面的相机是否有位置偏移。

  [UE4]添加手柄

 

  

 

相关文章:

  • 2021-10-01
  • 2021-04-27
  • 2021-05-25
  • 2022-12-23
  • 2021-04-16
  • 2022-12-23
  • 2021-07-24
  • 2021-09-01
猜你喜欢
  • 2022-02-02
  • 2022-01-18
  • 2021-12-19
  • 2022-01-09
  • 2021-05-27
  • 2021-10-22
  • 2022-12-23
相关资源
相似解决方案