Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Game Development How to Make a Video Game Pickups Spawn Pickups Randomly

Baron Hill
Baron Hill
25,349 Points

No new flies spawning, error

I can't get the new flies to spawn. I'm getting an error in Unity "MissingReferenceException: The object type 'GameObject' has been destroyed but you are still trying to access it." Anyone run into this issue? I've probably missed a connection somewhere.

3 Answers

Baron Hill
Baron Hill
25,349 Points

I figured this out. I needed to delete the Fly prefab from the hierarchy window since flies are now being spawned by the fly spawner.

Maynila Voravongsengq
Maynila Voravongsengq
10,558 Points

I have the same problem. However I did not see the FlyManager anywhere. And I can not see the GameObject in Hierarchy windows. but I have FlySpawner script. what should I do?

Maynila Voravongsengq
Maynila Voravongsengq
10,558 Points

I fixed by re create the empty gameobject.