i want a camera follow player on y axis but when my background end i want to stop camera.
so far i figured out how to follow player on y axis but i cant find out how to make camera just show my background. Its a 2D game
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollowY : MonoBehaviour {
public Transform target;
void LateUpdate() {
transform.position = new Vector3(transform.position.x, target.position.y, -10);
}
}