Group Group Group Group Group Group Group Group Group

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

#1

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.
}

#2

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

#3

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.

closed #4

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