Hi, I was wondering a way I can get my camera to only be able to go up Smooth on the y axis and not on the x-axis. This is for a mobile doodle jump like game. Here is the code I’m using.
public class camerafollow : MonoBehaviour
{
public float dampTime = 0.15f;
public Vector3 offeset;
private Vector3 velocity = Vector3.zero;
public Transform target;
private void FixedUpdate()
{
Vector3 mpos = target.position + offeset;
transform.position = Vector3.SmoothDamp(transform.position, mpos, ref velocity, dampTime);
}