How do i fix this error? And how do i make the bullets shoot from the camera view?

using UnityEngine;
using System.Collections;

public class NewBehaviourScript1 : MonoBehaviour {
public Vector3 updatedTransform;

public Rigidbody bullet;

public float speed = 20f
// Use this for initialization
void Start () {

}
void fire () {
	
	
	
	Rigidbody bulletClone = (Rigidbody) Instantiate (bullet, updatedTransform, transform.rotation);
	
	bulletClone.velocity = transform.forward * speed;
	
	
	
}
// Update is called once per frame
void Update () {
	if (Input.GetButtonDown("Fire1")) {
		
		fire();
		
	}
	
	updatedTransform = new Vector3(this.transform.position.x, this.transform.position.y, this.transform.position.z + 1);

}

}

This is the error message
Assets/Scripts/NewBehaviourScript1.cs(11,12): error CS1519: Unexpected symbol `void’ in class, struct, or interface member declaration
How do i fix it? Also how do i make the bullets come from the camera view? :slight_smile:

Your error is a missing ‘;’ at the end of line 3. As for making it come from the camera view. One way is to make the spawn point (i.e. whatever object you are using to initialize ‘updatedTransofrm’) a child of the camera and located in front of the camera. Then change line 14 to:

bulletClone.velocity = updatedTransform.forward * speed;