Skip to main content
Up and Coming
September 25, 2015

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)
    This topic has been closed for replies.

    4 replies

    Inspiring
    September 25, 2015
    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.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    saviorntAuthor
    Up and Coming
    September 25, 2015
    "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.
    Current WIPs using Unreal Engine 4: Agrona - Tales of an Era : Medieval Fantasy MORPG
    Up and Coming
    September 27, 2015
    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!"));
    DK2. Phenom 2 x4 4.2GHz,Asrock Extreme 3 970,8GB DDR3 1600, R9 270x 1180/1400.
    saviorntAuthor
    Up and Coming
    September 27, 2015
    That gives me an idea where to look, ty sir. I may open up the hood and make it blueprintable :lol:
    Current WIPs using Unreal Engine 4: Agrona - Tales of an Era : Medieval Fantasy MORPG