I understand that i may need a function, but i followed his video tutorial EXACTLY how he did it. The only difference is he got no errors with the same exact code. he is the code i wrote. It looks a little messeed up because of the small window space.
using UnityEngine;
using System.Collections;
public class Weapons : MonoBehaviour {
public float FireRate = 0;
public float Damage = 10;
public LayerMask NotToHit;
float TimeToFire = 0;
Transform FirePoint;
// Use this for initialization
void Awake () {
FirePoint = transform.FindChild (“FirePoint”);
if (FirePoint == null) {
Debug.LogError (“NO FIREPOINT? WHAT”);
}
}
// Update is called once per frame
void Update () {
if (FireRate == 0) {
if (Input.GetButtonDown (“Fire1”)) {
Shoot();
}
} else {
if (Input.GetButton (“Fire1”) && Time.time > TimeToFire){
TimeToFire = Time.time + 1/FireRate;
Shoot();
}
}
}
void shoot () {
Debug.Log (“Test”);
}
}