✅ 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)

9 Replies
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 errorso i should change it to a value like 1 and it should remove the error?
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
so i should put an objects name in there somewhere and that should fix it?
In a way
I recommend you learn the basics, then everything should be explained: $helloworld
ok thanjks
$code
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/