Chapter 8 - Starter Code - Gun.cs start() method

void Start ()
{
audioSource = GetComponent();
audioSource.PlayOneShot(SoundManager.Instance.gunFire); // <== line 48
// line 48. call to SoundManager.Instance.gunFire is causing a NULL reference exception.
// Apparently is too early to call.
}

Never mind. This is discuss later in chapter 8 - Managing script order
Sorry about that

That’s good to know - typically when readers run into planned issues, but don’t know that is expected behavior, then we aren’t doing a good enough job to let the user know. I’ll keep this in mind for the next update. Thanks for the heads up.

This topic was automatically closed after 166 days. New replies are no longer allowed.