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 Game Audio Play Sounds with Scripts

Cant add script component... Script Class cannot be found.

when ever i try to add the "RandomSoundPlayer" to the Bird Calls it replies with Can't add Script component 'RandomSoundPlayer' because the script class cannot be found. how do i fix this

2 Answers

Seth Kroger
Seth Kroger
56,414 Points

It's a bit difficult to diagnose without seeing your code and directory structure of your Scripts folder, but I would start by double-checking that the script file and the class inside it are both named "RandomSoundPlayer" without any typos and that the class compiles without errors.

thanks. it worked