[Unity] Camera(카메라)

박호준·2022년 2월 11일
0

Unity

목록 보기
5/17

clear Flags : 빈화면을 어떻게 할건지 결정

  • Depth_only : 카메라 여러개 할 때

cullingMast : 특정 layer만 보이게함

projection : 원근감

Filed of View : 시야 뷰

physical Camera : 실제 카메라설정처럼

clipping Planes : 보이는 범위 정도

Depth : 카메라 보여주는 우선수위 culling Mask와 섞어서 사용

대상을 따라다니게 하는 카메라 만들기

public class camera : MonoBehaviour
{
    [SerializeField]
    private GameObject go_Target;

    [SerializeField]
    private float speed;

    private Vector3 difValue;

    void Start()
    {
        difValue = transform.position - go_Target.transform.position;
        difValue = new Vector3(Mathf.Abs(difValue.x), Mathf.Abs(difValue.y), Mathf.Abs(difValue.z));
    }

    void Update()
    {
        this.transform.position = Vector3.Lerp(this.transform.position, go_Target.transform.position + difValue, speed);
    }
}
profile
hopark

0개의 댓글