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

**URL:** <https://forums.kodeco.com/t/chapter-8-starter-code-gun-cs-start-method/46984>\
**Category:** Unity Games by Tutorials\
**Created:** [August 21, 2018, 3:26pm UTC](https://forums.kodeco.com/t/chapter-8-starter-code-gun-cs-start-method/46984 "2018-08-21T15:26:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jollyto](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jollyto/32/81494_2.png) [@jollyto](https://forums.kodeco.com/u/jollyto)\
**Post date:** [August 21, 2018, 3:26pm UTC](https://forums.kodeco.com/t/chapter-8-starter-code-gun-cs-start-method/46984/1 "2018-08-21T15:26:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jollyto](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/jollyto/32/81494_2.png) [@jollyto](https://forums.kodeco.com/u/jollyto)\
**Post date:** [August 21, 2018, 5:05pm UTC](https://forums.kodeco.com/t/chapter-8-starter-code-gun-cs-start-method/46984/2 "2018-08-21T17:05:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bdmoakley](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/bdmoakley/32/108772_2.png) [@bdmoakley](https://forums.kodeco.com/u/bdmoakley)\
**Post date:** [August 24, 2018, 6:42pm UTC](https://forums.kodeco.com/t/chapter-8-starter-code-gun-cs-start-method/46984/3 "2018-08-24T18:42:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [February 4, 2019, 7:26am UTC](https://forums.kodeco.com/t/chapter-8-starter-code-gun-cs-start-method/46984/4 "2019-02-04T07:26:26Z")

</div>

Closed on February 4, 2019, 7:26am UTC

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