C
C#2y ago
ONW-Uno

✅ (SOLVED)Help a Beginner

i am following CodeMonkeys 11Hr youtube video on coding a game in unity. I have ran into a issue where unity wont even open the project besides in safe mode even though the errors it is telling me needs fixed are from scripts that i haven't touched in a while. im asking for help with how to solve whatever weird issue im having and i just hope my project didnt corrupt over the time i was at work. Thanks in advance.
36 Replies
ONW-Uno
ONW-UnoOP2y ago
im willing to screen share or take whatever screen caps are needed to fix this so i can continue following along. im just not sure what went wrong
Buddy
Buddy2y ago
Based on a guess you've probably tried to compile it Check project directory if a bin and/or obj exists and delete them Also go into preferences -> external tools, and click 'regenerate csproj' in Unity editor
ONW-Uno
ONW-UnoOP2y ago
yes it compiles whenever i go back to unity from VS, i restarted unity and now the safe mode stuff is happening. i will send directory next
ONW-Uno
ONW-UnoOP2y ago
The only new object that was added was another counter type it all was working until I started working on state machine and any SO scripts no longer allow me to create new SOs i selected visual studio i found the generate .csproj files do i check off every box before regenerating?
ONW-Uno
ONW-UnoOP2y ago
Buddy
Buddy2y ago
Only keep the first 2 checked. From top to bottom Embedded packages and local packages Then press regenerate
ONW-Uno
ONW-UnoOP2y ago
okay nothing changed in unity but it did update in Visual Studio
ONW-Uno
ONW-UnoOP2y ago
ONW-Uno
ONW-UnoOP2y ago
i didnt even touch this code at all when i made the new script for the stove counter thats why im so confused why i have the issues now and not when the base counter was implimented
Buddy
Buddy2y ago
Make sure the filename matches the class name And also make sure you have not compiled it. And remove any assemblies that might have been added. Unity will compile it for you automatically.
ONW-Uno
ONW-UnoOP2y ago
can i close unity while i skim the code or does it need to stay open? sorry if im asking to much this is the first project im using to learn
Buddy
Buddy2y ago
Please paste entire script here $paste
MODiX
MODiX2y ago
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
ONW-Uno
ONW-UnoOP2y ago
what specific script do you want the stove or the base counter
ONW-Uno
ONW-UnoOP2y ago
Buddy
Buddy2y ago
Whichever has the errors BaseCounter It seems
ONW-Uno
ONW-UnoOP2y ago
i just paste it on the website it opens right both have errors
Buddy
Buddy2y ago
Paste on site, press save and copy the link in the URL And then paste said link here
ONW-Uno
ONW-UnoOP2y ago
got ya one sec thanks alot
Buddy
Buddy2y ago
Oh, I see. You can't have two classes with the same name in the same namespace I can see that you have a BaseCounter in Scripts as well as one in Scripts/Counters
ONW-Uno
ONW-UnoOP2y ago
BlazeBin - prbaslfojuqy
A tool for sharing your source code with the world!
ONW-Uno
ONW-UnoOP2y ago
so i accidently duplicated it i guess?
Buddy
Buddy2y ago
It is possible
ONW-Uno
ONW-UnoOP2y ago
well deleting the duplicate fixed the 14 or so issues it said base counter had
Buddy
Buddy2y ago
So all good now?
ONW-Uno
ONW-UnoOP2y ago
ill try to reopen unity to see if it loads
ONW-Uno
ONW-UnoOP2y ago
only issues now:
Buddy
Buddy2y ago
Same thing there Duplicate file
ONW-Uno
ONW-UnoOP2y ago
ah i see
Buddy
Buddy2y ago
One in Scripts and one in Scripts/ScriptableObjects
ONW-Uno
ONW-UnoOP2y ago
fixed that now this
Buddy
Buddy2y ago
I think you should either learn basics of C# if you do not already know it, or look further on that tutorial. Seems you are doing things that you shouldn't.
ONW-Uno
ONW-UnoOP2y ago
ill rewatch some parts like i said i had it working fine no issues until the section im at now and its just a road block to me, thanks for your help
Buddy
Buddy2y ago
Anytime.
ONW-Uno
ONW-UnoOP2y ago
solved the issues read through found i accidently deleted two breaks after my state changes game now runs as intended
Thinker
Thinker2y ago
(you can close the post by typing /close)
Want results from more Discord servers?
Add your server