I would like to make a 2D scrollable map using camera scrolling, however I have no idea on how should I go about doing it. Can anyone help me with this? Thanks.
I assume your map is on the x,z plane.
float pan_speed = 10.0f;
function Awake(){
camera.y = 100; //put the camera above the world
camera.Rotate(transform.right, 90); // transform the camera on
}
function Update(){
if(Input.GetKey("up"))
camera.Translate(Vector3.forward * Time.deltaTime * pan_speed, Space.World);
if(Input.GetKey("down"))
camera.Translate(-Vector3.forward * Time.deltaTime * pan_speed, Space.World);
if(Input.GetKey("left"))
camera.Translate(-Vector3.right * Time.deltaTime * pan_speed, Space.World);
if(Input.GetKey("right"))
camera.Translate(Vector3.right * Time.deltaTime * pan_speed, Space.World);
}