How do I make the camera move up? (Javascript)

I want to make the camera move up slightly when ‘r’ is pressed. I’ve made some code but for some reason it’s making the camera fly up really quickly.

function Start () {

}

function Update () {

if(Input.GetKeyDown (KeyCode.R));
	{
		transform.position = Vector3((transform.position.x),((transform.position.y+10)),(transform.position.z));
		}
}

Your code is moving the camera up 10 units per frame. Try:

private var speed = 2.0;

function Update () {
 
    if(Input.GetKeyDown (KeyCode.R))
    {
       transform.position = Vector3((transform.position.x),((transform.position.y+Time.deltaTime * speed)),(transform.position.z));
    }
}

Or:

private var speed = 2.0;

function Update() {
    if(Input.GetKeyDown (KeyCode.R))
        transform.Translate(0.0, speed * Time.deltaTime, 0.0);
}

This will move things up at the rate of 2 units per second.