Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Ambiguity in the manual

Discussion in 'Documentation' started by Estecka, Feb 7, 2017.

  1. Estecka

    Estecka

    Joined:
    Oct 11, 2013
    Posts:
    62
    https://docs.unity3d.com/Manual/editor-CustomEditors.html

    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.
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    I've created a bug for the documentation team. They will take a look and fix. Can't say how quickly this will be.