# How to move the camera depending on the score?

First i am very new to scripting , i have been days reading how to move the camara how i want but nothing works exactly.

I want to move the camara position Y (9) each time the score of the game reach 7 or a multiple of seven

Example:

``````     Score = 7  Move Camraa in Y 9
Score = 14 Move Camara in Y 9 more
Score = 21 Move Camara in Y 9 more
And so.....
``````

The script i have, the camara move Y wen the score reach 7 but never stops , it continuously moving in Y.

Here is the script , thanks for your help.

``````#pragma strict
var guiHeight : GUIText;
var myCamera : GameObject;
var sum : int = 2;

private var height: int = 0 ;

function Start () {
guiHeight.text = "Height: 0";
}

function Update () {

if(Input.GetButtonDown("Fire1")){
height += 1;
guiHeight.text = "Height: " + height;
}
if( height % 700 == 7 )
{
myCamera.transform.position.y += 9;
}
}
``````

You can use this, and if you werent starting at a height of zero, just add what you’re starting at to the transform changing at the end.

`````` #pragma strict
var guiHeight : GUIText;
var myCamera : GameObject;
var sum : int = 2;

private var height: int = 0 ;

function Start () {
guiHeight.text = "Height: 0";
}

function Update () {

if(Input.GetButtonDown("Fire1")){
height += 1;
guiHeight.text = "Height: " + height;
}
if( height%7 == 0 )
{
myCamera.transform.position.y = height*9;
}
}
}
``````