Search Unity

How can I change a cinemachine virtual camera position in scene view ? The camera is not moving

Discussion in 'Cinemachine' started by Chocolade, Dec 12, 2018.

  1. Chocolade

    Chocolade

    Joined:
    Jun 19, 2013
    Posts:
    933



    In the Scene view window top left when I'm trying to drag the camera on the red or green or blue I see it's changing the Position values in the Inspector and I see the camera moving but the view is not changing. The camera view in the scene and in the game view window stay still.

    In the Inspector in the Body part I can change the Camera Distance and Screen X and Screen Y values and it will move the camera but all other parameters in the body don't make any changes.

    I want to move the camera behind the characters.
     
    MaxLohMusic and adnanzmn97 like this.
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    If you have a Framing Transposer, then that sets the vcam position in relation to the follow target according to the placement rules you set. If you want the vcam to be somewhere else, you have to either turn off the procedural placement, or change the rules so that the vcam goes where you want. You can't just drag it because CM cannot infer the placement rules from a manually-set position.
     
  3. SerPaolo

    SerPaolo

    Joined:
    Mar 8, 2020
    Posts:
    1
    You won't be able to drag the camera in the scene view because it's locked with the object/sprite that it's following, BUT instead you can change the positions of the VM Cam inside the Inspector;'s cinemachine component:

    Inspector > CinemachineVirtualCamera > Body > Screen X (or Screen Y)


    Adjust the X and Y settings there and it will move the position of the camera.
     
    Sinutella, ugotstoopt and bradido like this.
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    You can also adjust the vcam's rotation (in the transform) to change the viewing angle
     
    LordFreddox likes this.
  5. LeBongo

    LeBongo

    Joined:
    Jan 24, 2019
    Posts:
    1
    Is there a way I can access these values through code?
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    vcam.GetCinemachineComponent<CinemachineFramingTransposer>().m_ScreenX = bla
    etc
     
    ugotstoopt likes this.
  7. Bung86

    Bung86

    Joined:
    Nov 21, 2020
    Posts:
    2
    Huh?
     
    Yecats likes this.