I’m using an orthographic camera which I control left and right movement like such:
void Update () {
//amount to move
float amountToMove = Input.GetAxisRaw("Horizontal") * CameraSpeed * Time.deltaTime;
//move the camera
transform.Translate(Vector3.right * amountToMove);
}
I need to restrict the camera so it cannot move past certain point of the x axis. I tried using clampf but I can’t seem to get it to work. Any suggestions?