
using UnityEngine;
public class PlayerCamera : MonoBehaviour
{
public float FollowSpeed = 2f; // Speed at which the camera follows the player
public Transform target;
public float yOffset = -1f; // Offset for the camera's y position
void Update()
{
Vector3 newPos = new Vector3(target.position.x, target.position.y + yOffset, -10f);
transform.position = Vector3.Lerp(transform.position, newPos, FollowSpeed * Time.deltaTime);
}
}