So I’ve been going through this page of the manual in order to learn how do program custom editor.
In the provided example, they create a script called LookAtPoint, which contains a variable named lookAtPoint.
Sure, “LookAtPoint” is not the same as “lookAtPoint”. When you’re a computer it makes a whole world of difference to have a Capital instead of a lower case; But when you’re a human being still trying to figure out the purpose of each line of code, (and this page of the manual is not very exhaustive on such explications), you might overlook such ambiguous details.
As a result, when they went and wrote in the editor script serializedObject.FindProperty(“lookAtPoint”);, I genuinely assumed it was about the COMPONENT and not its VARIABLE. (Actually I barely even noticed there was such a variable.) And when I reproduced this on my side, I scratched my hair for quite a while trying to figure where that NullReferenceException came from even though I was so close from what’s on the manual.
I was right about to ask for help on the forum before I figured it out.