Parsing error in C#

Hi, I’m very new to Unity and I can’t figure out what’s wrong with my code, for sure it’s really easy to see for expert eyes ^^’ (I got it when i added “if” function)


using UnityEngine;
using System.Collections;

public class Controller : MonoBehaviour {
	public float moveSpeed;
	private float maxSpeed = 5f;
	private Vector3 input;

void Start () {

}


void Update () {
	input = new Vector3 (Input.GetAxis ("Horizontal"),0, Input.GetAxis("Vertical"));
	if (rigidbody.velocity.magnitude < maxSpeed){
		GetComponent<Rigidbody>().AddForce (input * moveSpeed);
}
}

You missed a brace after the if function. It is good practice to format your code like this so that you can more easily spot these parsing errors.

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour 
{


	void Start () 
	{
	
	}

	void Update () 
	{
		if()
		{
			
		}
	
		else
		{
			
		}
	}
}