UE4.24版本MotionController无法连接HTC Tracker

查询到有效信息是4.24版本的MotionController的source设置为Special_1是无效的,尝试按照网上教程设置SteamVR也是无效的,升级到4.25版本也无效。
UE4.24版本MotionController无法连接HTC Tracker_第1张图片最终还是用C++代码调用USteamVRFunctionLibrary库实现了

  TArray DeviceIds;
  TArray TrackerIds;
  USteamVRFunctionLibrary::GetValidTrackedDeviceIds(ESteamVRTrackedDeviceType::Controller, DeviceIds);
  USteamVRFunctionLibrary::GetValidTrackedDeviceIds(ESteamVRTrackedDeviceType::Other, TrackerIds);
  DeviceIds.Append(TrackerIds);

  if (DeviceIds.Num() > 0)
  {
    FVector loc;
    FRotator rot;
    USteamVRFunctionLibrary::GetTrackedDevicePositionAndOrientation(DeviceIds[0], loc, rot);
    TrackerMesh->SetRelativeLocationAndRotation(loc, rot);
  }

你可能感兴趣的:(UE4)