Hello there strangers,
I seem to be in a pickle over this matter, I have all the correct refrences for my scripts(I think!) but there is no object spawning and I keep getting the error message: Object refrence not set to an instance of an object
The following script is named PlayerController:
The error always trips on the following lines(Specifically the playerGun.isFiring) :
if(Input.GetMouseButtonDown(0))
{
playerGun.isFiring = true;
}
else if (Input.GetMouseButtonUp(0))
{
playerGun.isFiring = false;
}
playerGun is assigned in the following way:
public GunController playerGun;
The folllowing script is the GunController Script:
This is where I assign the isFiring method, but nothing seem to happen as it breaks on the above code.
public bool isFiring; // Boolean to check if the player is firing
Any help/Suggestions are much appreciated. As a note the GunController is attached to an object which is a child of another object which holds the playerController script.