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

Where do the scripts go for the flies so they work properly?

The flies don't move or die because it's gone from the hierarchy.

1 Answer

Alan Mattan贸
PLUS
Alan Mattan贸
Courses Plus Student 12,188 Points

The flies are not in the Hierarchy. Look for the Fly "Prefab" into the project. Probably the script FlyPickup must be attach to it. Add it into the prefab as shown in the video. And in the Hierarchy, the Game Manager has a script FlySpawner that spawn the Fly prefab into the game.