65 Replies
pls help anyone
and the code dosent work to
Picture 1*
have you installed a C# extension?
what u mean
oh wait
the code is done in Visual studio
alright, okie.. I just thought its vscode
no
so
also when i try to run code
Not sure whether it is applied implicitly, but shouldn't you have a namespace declaration at the top of the file?
hmm
you have a C# workload component installed?
from the VS Installer?
i dont think so
that's probably why you wouldn't have a correct highlighting
but in youtube video they did not declare namespace but still worked
does highlighting interfere with like when code is running?
nope actually, but it might help see you why the code is not running
oh
no it doesn't but if this means you don't have the C# workload, your code won't probably run
also, are you sure do you install them?
oh wait
i thinl i did not install Game dev with unity
checks those what I check, and you'll be alright
wait how do i acess The workload page
goto Visual Studio Installer
Modify
and you will see the screen like this
got it
you also don't forget to check the .NET desktop development as well, you need that too, I think
i check it before
alright
im new to VS and C# so..
and Unity
anyways thx guys
your welcome
hmm
it works
but the highlighting did not apply
that's weird, but can you hover on the text (or some function) if it does gives an information? and also does errors also shows as well? it's just probably an editor visual bug
there is no visible error
erm, maybe restart the VS?
yes it does
hmm ok
$unity
still dosent apply
wait nvm
sorry
stays the same
ive joined it already
$unityvs
I swear there was a tag for it
so, VS Unity workload shouldn't be installed right now?
$unitybug
If intellisense is not working for VSCode / Visual Studio, follow these steps.
Close the editor and re-open it again by double-clicking a script file.
This is the reason
As Unity is dumb that it doesn't detect (and set) Visual Studio if VS is installed after Unity.
Unity being Unity
sheesh
where is External tools
In Preferences
Unity Editor itself
?
oh
so
should i click ti
should i click regenrate project files
i click it
no
But you can try
Sometimes that can also be it
But it should work if you have this set to whatever code editor you want to use
And then exit the editor
then double-click a file in Project
it should be highlighted.
hm
so do i restart unity and vs
wait
it works
thx
anyways
was the code i did is in right way?
like 4 if statements
or can it be simplified
can't really be simplified
can still be simplified with Axis, but I think the current code is good for beginners
yea
im a beginner
so
what project do you recommend i do
2d or 3d
no, unity scripts are based on global classes
Use new Input System
old one is absolutely shit
If you want to play on a controller, you have to map the action for each control manufacturer (Xbox, Playstation) and so on.
Uh can you give an example please
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.