Oculus camera position appears incorrect

hi there :slight_smile:

I recently switched my game over to the FPS VR template, but I have a bit of a problem with the position of the camera in 3D space.

let’s say I walk up to the kitchen counter. above the counter is a cupboard.

If I play the game in normal 2D, I hit the collison of the counter at some point and the cupboard (which is around at eye height) is right in front of me. so far so good.

however, if I play the game in VR by the time I hit the collison of the kitchen counter I’m already inside the cupboard. it’s like the camera is a lot more forward than it’s supposed to be.
unfortunately, since my level is pretty small, that also means that I constantly clip through walls and doors when I walk up to them.

has anyone experienced that before and knows a solution to this?

using 4.7 with latest vr template and latest oculus runtime by the way.

thanks a lot!
chris

You probably have positional tracking enabled, and this move the camera around, is that what you are talking about? Also, it’s a good practice to have a “recalibrate” feature to center the camera correctly before starting the level, this way, you should be at the same place as the camera when you play normally.

Also, I know that for some reason in Unreal (at least in 4.5, it may have been fixed after that), the Camera was turn 90 degrees in relation to the character at level start. You may want to make sure that going forward in real life (toward the DK2 camera) actually does that in the game too.

Hope this can help!

Mick

hi mick!

thanks for the reply.
how can I turn off positional tracking and add a recalibrate feature? would you happen to have any tutorial links? :slight_smile:

thank you!
chris

You can use those in c++:

GEngine->HMDDevice->ResetOrientationAndPosition(Yaw);
GEngine->HMDDevice->EnablePositionalTracking(IsEnabled);

In Blueprint, you have the Reset Orientation and Position node under tyhe Head Mounted Display category,

You can also use console command HMDPOS ENABLE or DISABLE to change positional tracking settings.

I’m not sure what causes this, but it’s a problem I’ve had frequently too, even with the positional camera disabled. Following Michael’s answer should fix your problems, if it doesn’t, you could probably just increase the player hitbox to compensate. In the character blueprint (or VRPlayerController bp), I generally just set the “Reset Orientation and Position” node to activate on “Begin Play”. You can also bind it to a key press event or input action if desired.

how can I turn off positional tracking
and add a recalibrate feature?
Having a recalibration option is great, so definitely do that. But I’m not sure you want to turn off position tracking. Position tracking is really important for the player to feel immersed. Have you tried a VR experience that doesn’t use position tracking? It’s pretty odd for your real head movements to not produce a corresponding camera movement.

But your’e right that having position tracking on can cause the player to be able to put their head through objects. This is a new problem that’s unique to VR that doesn’t have a widely-adopted solution yet. Experiment; try to find an alternative that works. Maybe try fading the camera to black if the HMD starts to occlude an object. Even try turning off position tracking for a little bit and see how that feels. New problems like this are why VR is fun to work on right now.