❔ Attach to unity help

How exactly do I attach a C# code to a unity gameobject?
24 Replies
ShiftGamer2004
ShiftGamer2004OP15mo ago
How can I update the script inside unity so that it can display a debug.log?
Denis
Denis15mo ago
Have you tried googling for the answer?
ShiftGamer2004
ShiftGamer2004OP15mo ago
yes
Denis
Denis15mo ago
And what have you found What have you tried
ShiftGamer2004
ShiftGamer2004OP15mo ago
the question i just asked minus "so that it cna display a debug.log"
Denis
Denis15mo ago
Well
TheRanger
TheRanger15mo ago
display debug.log every frame? every 5 seconds?
ShiftGamer2004
ShiftGamer2004OP15mo 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
TheRanger15mo ago
C# window?
ShiftGamer2004
ShiftGamer2004OP15mo ago
lemme show
TheRanger
TheRanger15mo ago
class name isnt even the same
ShiftGamer2004
ShiftGamer2004OP15mo ago
hold up i opened the script shown in the image above what i just showed was the script
TheRanger
TheRanger15mo ago
the classname is different missing a using in the first few lines are u sure theyre the same file?
ShiftGamer2004
ShiftGamer2004OP15mo ago
yes
TheRanger
TheRanger15mo 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
ShiftGamer2004OP15mo ago
damn but yeah should i just make a new script then rename it before opening it or smt?
TheRanger
TheRanger15mo ago
you cant see this file in VS?
ShiftGamer2004
ShiftGamer2004OP15mo ago
wdym?
TheRanger
TheRanger15mo ago
the RPSManager file
ShiftGamer2004
ShiftGamer2004OP15mo ago
i can see it it sjust its a different name like you said
TheRanger
TheRanger15mo ago
idk try reopening VS and go to the same project file? its possible u had 2 projects of the same name
ShiftGamer2004
ShiftGamer2004OP15mo ago
ok got it fixed thx
Accord
Accord15mo 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.
Want results from more Discord servers?
Add your server