Search Unity

16:9 and 1920x1080 displays differently

Discussion in 'Cinemachine' started by Bupbupper, Oct 12, 2020.

  1. Bupbupper

    Bupbupper

    Joined:
    May 14, 2019
    Posts:
    5
    All of the default ratios display fine, 4:3, 16:10, etc.
    The camera's orthographic size automatically switches itself from 7.5 to 10 and I can't seem to stop it.
    Intended display size at 16:9-- upload_2020-10-12_0-58-24.png
    This is what happens when I change it to 1920x1080-- upload_2020-10-12_0-59-3.png

    I can't find a way to lock in the orthographic size. I'm using cinemachine and pixel perfect camera stuffs and a cinemachine confiner to separate rooms.

    I tried to programmatically set the ortho size of the camera in my room manager, but no dice.
    Here is said room manager if that helps. I'm at a bit of a loss.
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class RoomManager : MonoBehaviour
    6. {
    7.    
    8.     public GameObject virtualCam;
    9.     public Camera orthoCam;
    10.    
    11.     private void OnTriggerEnter2D(Collider2D other)
    12.     {
    13.         if(other.CompareTag("Player") && !other.isTrigger)
    14.         {
    15.             virtualCam.SetActive(true);
    16.             orthoCam.orthographicSize = 7.5f;
    17.         }
    18.     }
    19.     private void OnTriggerExit2D(Collider2D other)
    20.     {
    21.         if(other.CompareTag("Player") && !other.isTrigger)
    22.         {
    23.             virtualCam.SetActive(false);
    24.         }
    25.     }
    26. }
    Any help is appreciated, thank you!
     

    Attached Files:

  2. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    It's because the Pixel Perfect Camera needs to modify the camera's ortho size to achieve pixel-perfectness.