❔ NullReferenceException Object reference not set to an instance of an object Billboard.Update

Hello, my name is Zorphix and I'm not so smart at C#. And I'm currently trying to add a billboard script to a unity game inspired by Baldi's Basics In Education and Learning! I'm getting this error and I don't understand what it means. I don't know what and where to reference this object.
18 Replies
zorphix_zee
zorphix_zeeOP2y ago
The 2nd picture is a sprite renderer and I want it to follow the camera.
zorphix_zee
zorphix_zeeOP2y ago
Whoops, forgot to send the code.
TheRanger
TheRanger2y ago
means ur variable has no reference to an object
Auger
Auger2y ago
Either Camera or main or transform is null (idk unity)
TheRanger
TheRanger2y ago
hmm camera should be referenced there by default main is a static property did you add the camera to the scene?
zorphix_zee
zorphix_zeeOP2y ago
Yep
TheRanger
TheRanger2y ago
can u show?
zorphix_zee
zorphix_zeeOP2y ago
TheRanger
TheRanger2y ago
click on it and show me its inspector window
zorphix_zee
zorphix_zeeOP2y ago
TheRanger
TheRanger2y ago
Yup tag has to be MainCamera its Untagged
zorphix_zee
zorphix_zeeOP2y ago
Add tag?
TheRanger
TheRanger2y ago
u have non atm?
zorphix_zee
zorphix_zeeOP2y ago
wait no Sorry there is a MainCamera tag
TheRanger
TheRanger2y ago
it should be listed when u click on the combobox yeah select it, and ur error should disappear
zorphix_zee
zorphix_zeeOP2y ago
mk I'll test it. Yep! Thank you very much!
TheRanger
TheRanger2y ago
np
Accord
Accord2y 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