simple camera move script unity
void Update()
{
if (Input.GetKey(KeyCode.RightArrow))
{
transform.Translate(new Vector3(speed * Time.deltaTime, 0, 0));
}
if (Input.GetKey(KeyCode.LeftArrow))
{
transform.Translate(new Vector3(-speed * Time.deltaTime, 0, 0));
}
if (Input.GetKey(KeyCode.DownArrow))
{
transform.Translate(new Vector3(0, 0, -speed * Time.deltaTime));
}
if (Input.GetKey(KeyCode.UpArrow))
{
transform.Translate(new Vector3(0, 0, speed * Time.deltaTime));
}
if (Input.GetKey(KeyCode.W))
{
transform.Translate(new Vector3(0, speed * Time.deltaTime, 0));
}
if (Input.GetKey(KeyCode.S))
{
transform.Translate(new Vector3(0, -speed * Time.deltaTime, 0));
}
if (Input.GetKey(KeyCode.A))
{
transform.Rotate(new Vector3(0, -speed * 5 * Time.deltaTime, 0));
}
if (Input.GetKey(KeyCode.D))
{
transform.Rotate(new Vector3(0, speed * 5 * Time.deltaTime, 0));
}
}