Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Whenever I try to enter playmode after creating a script, a compiler error pops up

$
0
0
I started working in Unity yesterday on a project I had in mind. I started by implementing the playable character's sprite with the help of my friend who has worked with Unity for quite some time now. Everything seemed to be fine, and after creating the character's movement script (and putting some code in it), I tried entering playmode, which gave me the following message, *"All compiler errors have to be fixed before you can enter playmode!"* So my friend and I first tried checking the problem in the Console tab, which showed us that the root of the problem is somewhere in "Unity/Editor/Data/Mono/lib/mono/unity/smcs.exe", but we didn't manage to do much with this information, so we tried cleaning up the code instead, checking if there's anything wrong with it. Nothing, the code itself seems fine. So this is when we realized I should probably just restart the project. So I did- I deleted what little I've done in the broken one and started over, now taking small steps and checking if playmode is working, every time I add/change something. I implemented the sprites asset, changed it from Singular to Multiple (In the Sprite Renderer), sliced it in two, put the one I needed in the scene, everything just as I did before- And everything is fine so far and I can still enter the playmode. Now I got to the point where, last time, I created the script. I decided to not even bother giving it a proper name or adding any code to it, but this time, *just creating the script*. **Finally, the message I've been waiting for appeared,** the same one from earlier *(All compiler errors... blabla... playmode!)*. Now, I tried looking the error up on the internet, searching for every possible solution, and very few people seemed to have the same problem I do & ask about it on the forums- Actually, now that I checked those threads again, it seems like *non of them* have the same problem as mine. Anyways, the things I've tried so far are: - Restarting the computer - Uninstalling/reinstalling Unity - Manually reinstalling VisualStudio - Deleting the project and starting over - Upgrading to Windows 10 (But I also reverted back to 7- Did all of this because of a reoccurring VisualStudio installation error that I kept ignoring that mentioned Windows 10. *This* error doesn't happen anymore) - Putting down some seemingly legitimate code in the script - Checking if the code really is legitimate with the help of answers to similar problems on the forums (Most notably- *void start* in 4th line; *class name* and *script name* identical) - My friend and I even compared the code in each's newly-made scripts (Me and him have different computers), and it was identical (He hasn't bumped into any problems himself in Unity yet) ------------------------- Other things to keep in mind: - I *did* try deleting any script I have, and when I do that, playmode actually works, but that's because there's simply no script to make an error - Adding *any other component* that isn't a script *doesn't make any problems*. - The *"NewBehaviourScript"* script component *is* attached to said sprite that I did manage to put in game. The sprite itself doesn't create any problems. ------------------------------------ Thanks for reading and every little help or suggestion would be very appreciated. :)

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>