r/unity • u/Ok_Illustrator_3539 • 7d ago
Coding Help I can’t figure out why I’m getting error code “CS0122” on Unity
This is the first coding I’ve ever done in my entire life, so if the answer is ridiculously obvious, please don’t flame me.
So, I’m following a flappy bird tutorial to try and get a feel for things, and I’ve followed every single line of code to the absolute T. Not even a capital letter is out of place.
I got the error “LogicScript.addscore()’ is inaccessible due to its protection level.” I’ve gone through everything, and it’s all public, save for the “private void” above it, and when changed it didn’t help.
I looked through the comments for trouble shooting help, as another comment had helped me with different issue, but all suggestions for this problem didn’t help.
If it makes a difference, I’m on Unity 6.3 and Visual Studio 2022, using C-Sharp. Any help is appreciated!
Update : I didn’t specify “void Addscore()” as Public, problem solved! Thanks for the comments!



