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 Score, Enemies, and Game State Add a Start and End

What does it mean by the namespace "global" already contains a definition for "gameState"?

I got this error message when I tried to play it.

What can I do to fix this?

Henrique Vignon
Henrique Vignon
Courses Plus Student 6,415 Points

it should be the code in the script called "GameState" that should be added in your Game manager object

here I created a codeshare, just copy and paste in there https://codeshare.io/5N3OKV and I'll be able to see it

Actually sorry about all this. I realize what I did. Somehow I used the same code twice. Not quite sure how that happened but i think i fixed the problem.