Skip to main content
New Participant
May 8, 2014

Use parent objects rotation without Follow Orientation

I have a question regarding "Follow Orientation".


How do I get the rotation of a parent object and apply it to my OVRCameras (using the OVRCameraController.prefab) without using Follow Orientation?

The game object with OVRCameraController.cs attached (in the prefab OVR Camera Controller) correctly rotates when attached to a different parent object but the left and right cameras do not. If I drag the parents transform into the Follow Orientation field everything works properly, but because the characters are clones, I do not want to have to drag and drop the transform every time I switch players.

The OVRCameraController is being instantiated one time and when an instantiated character is selected, it attaches to that character as a child.

This is the hierarchy after a character is selected:

Character1(clone)
--OVRCameraController
Character2(clone)
Character3(clone)

Now, if the rotation of character1 is 0, it attaches with the correct facing direction. If I select Character2 (who has a rotation of 180), the OVRCameraController properly switches its parent and position but does not rotate the cameras. The OVRCameraController is rotated 180 but the left and right cameras are still 0. Now the hierarchy looks like this:

Character1(clone)
Character2(clone)
--OVRCameraController
Character3(clone)

I am probably making this far more complicated than it really is but I absolutely need help.

Thank you for reading!
    This topic has been closed for replies.

    1 reply

    Inspiring
    May 8, 2014
    You should be able to switch the "FollowOrientation" parameter programmatically at the same time you switch players.
    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