cancel
Showing results for 
Search instead for 
Did you mean: 

UE4, GearVR + Rift, will this work?

saviornt
Protege
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 4

cybereality
Grand Champion
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.

saviornt
Protege
"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.

opamp
Protege
The correct way would be to call GEngine->HMDDevice->GetHMDDeviceType();

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

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!"));

saviornt
Protege
That gives me an idea where to look, ty sir. I may open up the hood and make it blueprintable :lol: