Hi all,
I am quite new to unity and every time I try to drag my C# file into my game object, it says the following,

My script looks like this,
and I’m trying to drag the script to the player
If there is anything I did wrong, please say. thank you.
Hi all,
I am quite new to unity and every time I try to drag my C# file into my game object, it says the following,

My script looks like this,
and I’m trying to drag the script to the player
If there is anything I did wrong, please say. thank you.
That’s how you do it. Make sure you don’t have errors in the console. Make sure such a common name as “Player” doesn’t already exist in some other script in the project.
The name is not the issue as I have changed the name and the name in the script yet nothing changes.
The errors i get are these.

I get the yellow warning when I play the game and the red when I double click on the yellow.
Thanks
What is likely going on is that you have multiple packages installed with the same name. May you have imported the package through the package manager and imported the package as a custom package. Who knows without actually looking at your project directly.
Regardless something is blocking your application from compiling.
And if it can’t compile, then the editor can’t find your script.
You must find out what that is.
The error seems to suggest it’s the nunit.framework.dll, which is a unit testing package. Did you add this? Have you tried going into package manager and removing it? Do you need it? Does any of your code rely on it?
Delete the script and make a new one with a (for sure) unique name. Also try restarting Unity. I’m not convinced it always “flushes” any naming problems like this when you rename scripts, though afaik it’s supposed to.
I have given the script a new name that has not been used anywhere else (that name was nominationWall)
Upon restarting this has come up and I cannot open my project.
This is starting to smell more and more like the unfortunate tendency of Unity to barf random packages all over your projects. Definitely start removing packages you know you don’t need. It’s a maddening new “feature” of recent Unity releases that I call “Barfing the Kitchen Sink” into your project, when in fact almost nobody cares about those packages when learning, and anyone who wants them knows how to add them instantly and effortlessly.
Agreed. I haven’t used Unity for a little while now (and why I haven’t been on the forums like I used to be)… I moved across country and have been remodeling a 200 year old farm house.
But this past weekend I jumped back into a project of mine cause my partner really wants me to get something working for him. And I upgraded to the latest Unity to check it out. And ugh, it barfed so many random packages into my project which caused similar issues to OP.
Super annoying.
I don’t auto need the marketing/store/ads/unit testing/etc. If I wanted them, I know about them, and can easily search for them in the package manager. If I don’t know about them… well what do I need them in my project for?
Exactly. The UI and VS packages should be default. There’s an argument for TextMeshPro, so I’d forgive that one as well. Everything else, if you’re going to use it you will know you need to install it.
It probably wastes more time in errors from those packages, than it saves time from clicking a few buttons to install them. Plus, new Unity users get their first experience as a miserable one. Unity a few years ago was a little more throw you to the wolves, where it wasn’t obvious what to do or what your first steps were when you first open it. But it also didn’t start you off with code errors.
It’s gone on for too long. It’s just getting worse and worse… Analytics was the first one that used to get barfed into new projects and it’s all been downhill since then.