Search Unity

Cinemachine Virtual Cameras and Magic Window Mode

Discussion in 'Cinemachine' started by AquaGhost, Mar 15, 2018.

  1. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    We have a project that is in Virtual Reality with cinemachine cameras. We're trying to do a magic window version, but it seems like all the axes are off. So if you move up and down, it's correct, but if you turn a bit, and then move up and down, it causes a roll.

    Is this a known issue with virtual cameras?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    I've never heard anything like that before. Can you give some details of your setup? How are you using CM with VR?
     
  3. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    @Gregoryl We're making a VR film with timeline that has some gentle camera movements, but not free movement (character walks, etc, in a passive, scripted way). We have CM Brain on both the parent and the camera, which was the only way it agreed to move in VR. We are using GVR for the head.
    When we do magic window, it accurately turns the look using a touch and drag, but it won't work for the accelerometer, even though it works in VR. Also, in VR mode, dragging the side of the GearVR touchpad turns your look, which is not good.

    Is there any future plan to add some more support for a VR film using CM cameras? If not, we might want to adjust to just moving Main Camera using parents and transforms?
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    CM brain on both parent and camera sounds weird.

    Think of the CM brain as a kind of a puppeteer: it observes the virtual cameras (which are free agents, not parented to anything) and uses information from them to control the transform of the game object that it's attached to. Normally this would be a Unity Camera, but it doesn't have to be one.

    The expected setup for VR is this:
    The VR headset controls the Unity Camera's transform.
    Create a parent for the Camera, and put the CM brain on that.
    That way, CM drives the parent, and inside the parent is the headset-controlled camera, whose movement will be added to CM's.

    Have you tried setting it up that way?
     
    junaid109 likes this.
  5. AquaGhost

    AquaGhost

    Joined:
    Jan 27, 2013
    Posts:
    94
    @Gregoryl yeah we had tried that. Even though we usually try to move parents for VR, doing that wasnt letting it move. It still does the thing where it only allows the Look using screen drag.
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Well, you need to figure out what's going on there. Why doesn't moving the parent work? Seems to me that your problem lies there. Adding more CM brains until it "seems" to work is just going to confuse things. A single CM brain on the parent is the way to go.