My if statements are not working

So…Hi
I am what you would call a noob and I need someones coding superpowers to help me. As you can see I am trying to start a script which will move an object when ‘space’ is clicked. This is just the beginning of what I am going to make the code do.
I can’t continue because the if statement on line 14 doesn’t seem to like the ‘{’ symbol. It sais it is un-expected. I have tried moving it around into different places (Like below the if statement) but still, it is not working.

I know it seems like a simple error but I have been at it for ages and I can’t continue until I fix it. Thanks.:slight_smile:

using UnityEngine;
using System.Collections;

public class FlipScript : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		if (Input.GetKeyDown("Space"){
			transform.Translate(0,100,0);
		}
	}
}

An if statement looks like this…

if (condition)
{
}

The condition must be inside parentheses. Where you put the { and } doesn’t particularly matter, but you should be consistent.

Your condition is Input.GetKeyDown("Space"). And to repeat, that condition must be inside parentheses.

Given that information, can you see what you’re missing?