Unity is giving me an error Null Reference Exception on this line inside the Fire Function
tempBulPref = GameObject.Instantiate(tempoAmmoPref, fireLocation.transform.position, fireLoc
Everything Works fine until I call the Fire Function
class Weapon extends Item{
var range : float;
var rateOfFire : int;
var weaponType : weaponType;
var clipSize : int;
var fireLocation : Transform;
var bulletPrefab : ammoType;
var gWeaponManager : GameObject;
var tempoAmmoPref : GameObject;
function SetValues(){
gWeaponManager = GameObject.Find("Global Weapons Class Manager");
Debug.Log(gWeaponManager.name);
}
function Fire(){
var tempBulPref : GameObject;
tempBulPref = GameObject.Instantiate(tempoAmmoPref, fireLocation.transform.position, fireLocation.transform.rotation);
Debug.Log("Shots Fired");
}
}