Compile console error?

I start up the game, i go to the object, and the scripts on it do not have the name on it like ‘attack speed’ or whatever instead its just called “Script”. And the text says "The associated script cannot be loaded. Please fix any compile errors, and assign a valid script.

Before this all happened, I made a new script on the object to make a new script for scaling. But alone with that error, that script says "Assets/TheScriptName The namespace '; already contains a definition for {TheScriptName}

also had one that already deined start, and update (in console errors)
i’m not really sure what i did lol any help would be greatly appreciated.

This is pretty self-explanatory. Delete that new file and make a new one with a different name.

why did this happen, tho?

It happened because you already had a script with a class named TheScriptName and then you added another one with the same name. You either manually added it, made a copy of the same script in the Assets folder, made a script with the same name as a built in class or a class used in a Unity Package, or you’re doing something really stupid like putting your project folder inside Dropbox :wink:

1 Like