Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
saviornt's avatar
saviornt
Protege
11 years ago

UE4, GearVR + Rift, will this work?

In the GameMode:

- Event BeginPlay
- Branch | Condition: Is in Low Persistence Mode
-- True
--- Set HUDClass: OculusHUD
-- False
--- Set HUDClass: Gear VR Global Menu

I'm sure you can see where I am going with this, so will this work? (I don't have a phone nor gearVR to test it)

4 Replies

Replies have been turned off for this discussion
  • Are you trying to determine if the user is wearing a Rift or a Gear VR? I don't think that is the way to do it.

    Also, Gear VR uses low persistence as well.
  • "cybereality" wrote:
    Are you trying to determine if the user is wearing a Rift or a Gear VR? I don't think that is the way to do it.

    Also, Gear VR uses low persistence as well.


    Yea, trying to determine which device is being used. I didn't know that the Gear used LP... is there a way to distinguish the two devices?

    I did see that Rama had a plugin that had an OS determination feature, should this be the way to go?


    edit: Found it, there is a "Get Platform Name" Node in blueprints that I can use \o/ -- it should work in theory, but theory I have found is much different than real-life.
  • The correct way would be to call GEngine->HMDDevice->GetHMDDeviceType();

    https://docs.unrealengine.com/latest/INT/API/Runtime/HeadMountedDisplay/EHMDDeviceType__Type/index.html

    example

    if ( GEngine->HMDDevice.IsValid() ) //check pointer is valid
    {
    EHMDDeviceType result = GEngine->HMDDevice->GetHMDDeviceType();
    if ( result == EHMDDeviceType::DT_OculusRift ) UE_LOG(LogTemp, Warning, TEXT("Device is Rift"));
    else if ( result == EHMDDeviceType::DT_GearVR ) UE_LOG(LogTemp, Warning, TEXT("Device is GearVR"));
    else UE_LOG(LogTemp, Warning, TEXT("Device is Other"));
    }
    else UE_LOG(LogTemp, Error, TEXT("No device found!"));
  • That gives me an idea where to look, ty sir. I may open up the hood and make it blueprintable :lol: