# Chapter 10 Page 288 NullReferenceException:

**URL:** <https://forums.kodeco.com/t/chapter-10-page-288-nullreferenceexception/109282>\
**Category:** Unity Games by Tutorials\
**Created:** [May 17, 2020, 7:13pm UTC](https://forums.kodeco.com/t/chapter-10-page-288-nullreferenceexception/109282 "2020-05-17T19:13:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apmurthy](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/apmurthy/32/81494_2.png) [@apmurthy](https://forums.kodeco.com/u/apmurthy)\
**Post date:** [May 17, 2020, 7:13pm UTC](https://forums.kodeco.com/t/chapter-10-page-288-nullreferenceexception/109282/1 "2020-05-17T19:13:20Z")

</div>

When the game executes the following line of code

GetComponentInParent\<PickupSpawn\>().PickupWasPickedUp();

It gives me a “NullReferenceException” because Unity cannot find the Component “PickupSpawn” even though it exists in my “Heirarchy”.

I am at Page 288 of “Unity Games by Tutorials v3.1” .

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![ghostwolf](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ghostwolf/32/81494_2.png) [@ghostwolf](https://forums.kodeco.com/u/ghostwolf)\
**Post date:** [May 20, 2020, 12:48am UTC](https://forums.kodeco.com/t/chapter-10-page-288-nullreferenceexception/109282/2 "2020-05-20T00:48:29Z")

</div>

In your code for pickupspawn is pickupwaspickedup made public? And are the names the same.

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 6, 2020, 11:19pm UTC](https://forums.kodeco.com/t/chapter-10-page-288-nullreferenceexception/109282/3 "2020-07-06T23:19:48Z")

</div>

@apmurthy Do you still have issues with this?

---

<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:** [October 31, 2020, 11:13am UTC](https://forums.kodeco.com/t/chapter-10-page-288-nullreferenceexception/109282/4 "2020-10-31T11:13:22Z")

</div>

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