You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class CameraSizeToVelocity2D : MonoBehaviour
{
public Rigidbody2D target;
[SerializeField]
private float minCam;
[SerializeField]
private float maxCam;
private float playerVel;
private float smooth = 0.5f;
private Camera cam;
void Start()
{
cam = Camera.main;
}
void Update()
{
if (target != null)
{
//clamp the size of the camera to desired min and max values, use rigidbodys velocity vectors X value for horizontal movement, Y value for vertical movement