How do i fix this parsing error?

using UnityEngine;
using System.Collections;
var bullitPrefab : Transform;
public class NewBehaviourScript2 : MonoBehaviour

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () 
		{
			if(Input.GetButtonDown("Fire1"))
			{
				var bullit =Instantiate(bullitPrefab, transform.position, transform.rotation);
				bullit.rigidbody.AddForce(transform.forward * 4000);
			}
		}

This the the error code i get
Assets/Scripts/NewBehaviourScript2.cs(3,19): error CS8025: Parsing error

If someone could tell me how to fix this it would be much appreciated as i am a noob with programming :smiley:

On line 3, you are using a Javascript declaration and declaring a variable out side the class. I’d also make this a GameObject instead of a Transform. On line 4, you are missing the opening ‘{’ (and the matching close brace at the end of the file). Line 16 needs an ‘as GameObject’. Try this instead:

using UnityEngine;
using System.Collections;

public class NewBehaviourScript2 : MonoBehaviour {
	
	GameObject bullitPrefab; 
	
	void Update () 
	{
		if(Input.GetButtonDown("Fire1"))
		{
			GameObject bullit = Instantiate(bullitPrefab, transform.position, transform.rotation) as GameObject;
			bullit.rigidbody.AddForce(transform.forward * 4000);
		}
	}
}