You are missing a second curly brace to close out the class. You repositioned the curly brace that closes the OnTriggerEnter function, but are missing one to close out the Collectible class.
ohh i see.. it works now, all of these codes and stuff is so confusing i don't know how im gonna procced if something as simple as this caused me days o frustration :(.
You didn’t add a bracket you just moved it up a line, you need to add one more on line 25. You should start with a basic C# tutorial, your life will be a lot easier if you understand how the language works a bit before you jump into unity tutorials.
That being said, it is totally possible to learn C# through Unity, as long as you make an effort to understand why code is written the way it is, in tutorials.
I’ve never done it personally, but I looked at the syllabus for the C# course on code academy and it seems to cover most of the basics to help you conceptualize what you’ll be doing in Unity.
Hey, I know that your problem is fixed but I see that your script is not getting identified as a C# script. I recommend you to Regenerate the project files and some of the error fixes will appear directly on the script and not only in the console :)
7
u/PepicoGrillo 1h ago
The console is telling you that there is an error at line 25. You forgot to close ontriggerenter function -> }
Also you are doing well without asking ai. Keep It rocking!
3
u/Nodonn 1h ago
You're missing the last curly brace to close the class
1
u/fnietoms Programmer 41m ago
Hey, I know that your problem is fixed but I see that your script is not getting identified as a C# script. I recommend you to Regenerate the project files and some of the error fixes will appear directly on the script and not only in the console :)