エッセイマンガ!オタクビアンカップル同棲日記「よめよめ」

同棲中のレズビアンカップルのゆんとあゆむが、日々の生活の様子をマンガや日記にしてお届けするブログです

Unity2Dゲーム制作基本!プログラムでカメラ追従!

 

 

    [SerializeField] GameObject player;

    // Start is called before the first frame update
    void Start()
    {
        Debug.Log(player.transform.position);
    }

    // Update is called once per frame
    void Update()
    {
        if (player.transform.position.x > 8f && player.transform.position.x < 32.9f)
        {
            transform.position = new Vector3(player.transform.position.x, 0.08f, -10);
        }
    }