Lighting and Camera issues in VR.

Hi! I’m making a Oculus Rift game with the latest unity 5 I wanted to point out I’m working on the game and testing this whole new VR Unity 5 stuff with a DK1 Oculus Rift. If these are issues not present in a DK2 or GEAR VR, someone please let me know! :wink:

Lighting issues:
but I’m noticing after I made a scene that is inside of a house whenever I try to place lights down with VR mode enabled I get a message saying this:


Directional lights are the only lights that work, and when I disable VR mode for unity 5 all the lights work again. Does VR mode in Unity 5 not support lights and I didn’t read that piece of information yet? haha

Camera Issues:
Whenever you place a VR camera down in a new scene you typically want to have it facing your set-piece of whatever you created in your scene. However once you hit the play button and I put on my Oculus Rift, I notice that the direction I started the game in while facing forward and wearing my Rift isn’t the angle I set up in the editor. I have to turn my entire body to straighten myself out. The old OVR plugins included scripts for re-centering the camera so I wish there was a more simple quick way to get that set up here as well so I wouldn’t have to turn my entire body to whatever the in-game turns the camera upon playing.

Here is picture examples of this happening;
The red dot “VR PLAYER” is the center of the VR HMD screen so the player as a ridicule. The main camera mover is the object the Camera is parented to as that is the only way to move a VR camera in unity, but this “Camera Flicking” issue happens regardless of the VR camera being parented to an object or not.

In editor before Play as the Camera is focused to face the scene.

In-game as somehow the camera gets flicked in a opposite direction upon play.

This can be fixed with a recenter script I suppose that recenters the camera upon input, but that is a script that was included with the old VR plugin from Oculus that doesn’t work anymore with Unity with this new VR update :frowning:

I suggest Unity on their asset store page release a VR scene example with great code already there to help developers get started on their projects without these issues arising? Kinda like what they did with their free Unity 4/5 UI asset examples.

I believe the latest patch of unity5.1p3 had a recenter on start added…hope that helps. Make sure to backup your project folder before trying it!

  • (none) - VR: Reset camera-to-origin pose on scene load to prevent gross error.

If you need to add the ability to reset, add this code after your start. You could also use a key or button to trigger the reset…i put it on the down click of my controllers analog stick.

VR.InputTracking.Recenter()

Is that one of those beta updates? Like the pre-release ones? I’m on Unity 5.1.1f1 which is the latest consumer/normal version.

Nope. P3 is the latest patch. You can get patches from here.

1 Like

@BokuDev The Recenter is fixed in the patch that HeadTrip and Hugo referenced. As for the lighting, All light types are working for myself in the 5.1.1p3 patch and if I recall correctly, they were working in builds prior to that as well. Try the latest patch, but if it doesn’t work, file a bug report with an example project already setup and reproducible steps.

Alright I will be updating the patch again, but since you are from Unity Technologies, do you know of any situations in the editor where lights would be disabled like they are for me by any chance?