15 Replies
I tried putting private and public infrastructure but there's just another issue with that so
Create a new project that does not use the top level statements feature
Top level statements (which is the default now) is just causing confusion.
There's a checkbox when you create the project in Visual Studio.
Or you can use --use-program-main if you use dotnet new CLI command
Uhhh, like an entire new game or smth?
Sry I'm quite new to coding so I'm kinda clueless just trying to make a small platformer level for a test
Just re-create a new blank project that doesn't use top level statements (check the box in the new project dialog) and then copy your code over
OK I think I understand. I'll try that
Thx
If that doesn't work, use $paste to show your full source code (photos of your monitor are hard to parse) and someone can help show what the issue is.
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!
$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!
ok i put my code into that but idk waht to do after taht
You need to paste the link here.
But your problem is most likely that you have put things outside the class braces for a mono behaviour
I would highly recommend learning the basics of c# before doing unity
C# is case-sensitive btw
This method in Unity is
FixedUpdate()
, not fixedUpdate()
Far as fixing your error goes, remember that all methods must be within classes1. there's an extra semicolon after
void fixedUpdate()
2. VS should underline all errors (like the misspelled Vecotr3
etc.); if it doesn't, you're probably not opening the project/script correctly
3. that one error message displayed in Unity is probably not enough to solve the problem, maybe there are more errors in the Console?Ahhh thanks so much
Yea I added the semi colen to see if that was the problem and it wasent I just forgot to remove it