Can't use tranform.position.z

I’m a beginner and I’m trying to use this code

 function Start () {
    
    }
    
    function Update () {
    	if (Input.GetButtonDown("Jump"));
    	{
    		transform.position.z +=5;
    	}
}

but it gives me an error saying

Assets/Move1.js(10,38): BCE0044: expecting :, found '+='.

2 Answers

2

You misunderstand the problem. Take out the semicolon at the end of this line.

 if (Input.GetButtonDown("Jump"));

You have a semicolon behind the if statement. Remove it.