Search Unity

  1. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

When VR is enabled, Projectors are moved around like VR cameras

Discussion in 'AR/VR (XR) Discussion' started by greenmonster, Mar 14, 2016.

  1. greenmonster


    Jan 18, 2013
    Using 5.3.3p1, I have a VR project (VR Support checkbox checked), and in this project I have a Projector casting a shadow onto the ground (since Unity's support for Mixed mode lighting isn't working).

    When I hit play or run from a build, the Projector's transform is updated as if it were a VR camera, and therefore the projected shadow flies all over the place according to my headset's movement.

    Doesn't seem to be a way to force the position/rotation to keep its original value as the transform is getting updated deeper within the pipeline I think.

    So far I have tried:

    1) Setting transform's position and rotation in LateUpdate()
    2) Adding a kinematic Rigidbody to the Projector's gameobject, with position and rotation frozen on all axes.
    3) Marking the Projector's gameobject static.

    Also tried seeing if I could override the position/rotation in OnWillRenderObject but wasn't able to get that function to be called for some reason.

    Any other ideas on how I can work around this? Any help is appreciated!
  2. Jodon


    Sep 12, 2010
    Really odd, I saw this with Fast Shadow Projector which is a plug-in I purchased in order to get faster shadows on mobile. I hadn't seen the issue with the built-in Unity Projector, but it had the exact same issue you're describing. I ended up having to ditch it and go with low quality real-time shadows.