C
C#4w ago
Vikving

✅ i would need help with this error "Object reference not set to an instance of an object"

i know its common but i really cant find tutorials on how to fix this or atleast i dont understand them probably because im a begginer that started a week ago, im using unity and ill include a photo of the code line (21st line)
No description
9 Replies
Angius
Angius4w ago
That error means something is null For example, it seems to me, that your countText never has it's value set So it is null null does not have the .text property Hence the error
Vikving
VikvingOP4w ago
so i should change it to a value like 1 and it should remove the error?
Angius
Angius4w ago
Change what to a value like 1? Not countText, that's for sure, since I really don't think you can cast an int to a TMP_Text
Vikving
VikvingOP4w ago
so i should put an objects name in there somewhere and that should fix it?
Angius
Angius4w ago
In a way I recommend you learn the basics, then everything should be explained: $helloworld
Vikving
VikvingOP4w ago
ok thanjks
Anton
Anton4w ago
$code
MODiX
MODiX4w ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/

Did you find this page helpful?