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? ![]()