✅ (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
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
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
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
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?
Only keep the first 2 checked.
From top to bottom
Embedded packages and local packages
Then press regenerate
okay nothing changed in unity but it did update in Visual Studio
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
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.
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
Please paste entire script here
$paste
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!
what specific script do you want the stove or the base counter
Whichever has the errors
BaseCounter
It seems
i just paste it on the website it opens right
both have errors
Paste on site, press save and copy the link in the URL
And then paste said link here
got ya one sec thanks alot
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
BlazeBin - prbaslfojuqy
A tool for sharing your source code with the world!
so i accidently duplicated it i guess?
It is possible
well deleting the duplicate fixed the 14 or so issues it said base counter had
So all good now?
ill try to reopen unity to see if it loads
only issues now:
Same thing there
Duplicate file
ah i see
One in Scripts and one in Scripts/ScriptableObjects
fixed that now this
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.
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
Anytime.
solved the issues read through found i accidently deleted two breaks after my state changes
game now runs as intended
(you can close the post by typing
/close
)