Chapter 10 Page 288 NullReferenceException:

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.

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

@apmurthy Do you still have issues with this?

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