❔ Attach to unity help

How exactly do I attach a C# code to a unity gameobject?
24 Replies
ShiftGamer2004
ShiftGamer20049mo ago
How can I update the script inside unity so that it can display a debug.log?
Denis
Denis9mo ago
Have you tried googling for the answer?
ShiftGamer2004
ShiftGamer20049mo ago
yes
Denis
Denis9mo ago
And what have you found What have you tried
ShiftGamer2004
ShiftGamer20049mo ago
the question i just asked minus "so that it cna display a debug.log"
Denis
Denis9mo ago
Well
TheRanger
TheRanger9mo ago
display debug.log every frame? every 5 seconds?
ShiftGamer2004
ShiftGamer20049mo ago
nonono so like i put in a debug log in the C# window but in unity, it doesnt show that in the script
TheRanger
TheRanger9mo ago
C# window?
ShiftGamer2004
ShiftGamer20049mo ago
lemme show
TheRanger
TheRanger9mo ago
class name isnt even the same
ShiftGamer2004
ShiftGamer20049mo ago
hold up i opened the script shown in the image above what i just showed was the script
TheRanger
TheRanger9mo ago
the classname is different missing a using in the first few lines are u sure theyre the same file?
ShiftGamer2004
ShiftGamer20049mo ago
yes
TheRanger
TheRanger9mo ago
ur file in unity is called RPSManager something but in VSCode, its called NewBehaviourScript1.cs i doubt its the same file u may have hidden a word but you forgot one
ShiftGamer2004
ShiftGamer20049mo ago
damn but yeah should i just make a new script then rename it before opening it or smt?
TheRanger
TheRanger9mo ago
you cant see this file in VS?
ShiftGamer2004
ShiftGamer20049mo ago
wdym?
TheRanger
TheRanger9mo ago
the RPSManager file
ShiftGamer2004
ShiftGamer20049mo ago
i can see it it sjust its a different name like you said
TheRanger
TheRanger9mo ago
idk try reopening VS and go to the same project file? its possible u had 2 projects of the same name
ShiftGamer2004
ShiftGamer20049mo ago
ok got it fixed thx
Accord
Accord9mo ago
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.