using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour
{
    public Transform player;
    private Vector3 currentPlayerPosX;
    private Vector3 newPlayerPosX;

    public float FollowSpeed = 2f;
    public Transform Target;


    // Start is called before the first frame update
    void Start()
    {
        // currentPlayerPosX = new Vector3(player.transform.position.x +6 , transform.position.y,-10);
        // newPlayerPosX = new Vector3(player.transform.position.x -6 , transform.position.y,-10);
    }

    // Update is called once per frame
    void Update()
    {
        // transform.position = new Vector3(player.transform.position.x + 6, transform.position.y, -10);

        // if (player.GetComponent<Player>().facingright==true)
        // {
        //     transform.position = new Vector3(player.transform.position.x -6 , transform.position.y , -10);
        // }



        transform.position = new Vector3(player.transform.position.x + 6, transform.position.y, -10);

        if (player.GetComponent<Player>().facingright==true)
        {
            transform.position = new Vector3(player.transform.position.x -6 , transform.position.y , -10);
        }
    }



}
