Search Unity

Code syntax

Discussion in 'Getting Started' started by CodeWurm, Jul 31, 2019.

  1. CodeWurm

    CodeWurm

    Joined:
    Nov 8, 2014
    Posts:
    194
    I got a question for the more experienced programmers out there.

    - How do you know what function to use in your code to achieve what you want?

    For example: You make a public gameobject and then you use Instantiate() to spawn it. How to search in the documentation if you know what you want to achieve, but don't really know how the function is been called.
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,548
    Google. Going through the documentation by hand or through the official search that they provide is the least efficient way to find an answer. Google is one of the most powerful tools available to you and the sooner you become familiar with it the better off you are.

    For your example you want to know how to add an object to a scene. If I open Google and type "site:docs.unity3d.com add object to scene" the answer will almost always be the first result and if it isn't it will be on the first page. Additionally Google will provide a list of similar searches with the answers that they have accepted.

    upload_2019-7-31_13-33-58.png
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,540
    I recommend reading almost the entire Unity manual, focusing not on specifically how things are implemented, but familiarizing yourself generally what Unity provides and the expectation for how you would use that functionality.

    Then as you are developing your game you will often encounter problems where you remember Unity has some functionality for that, so you then find it again in the manual, look up the finer details in the Scripting Reference, and google for forum threads on the topic for exactly how best to use the feature.

    Also, I find that if you stay aware of what is being talked about on the various subforums here it helps with knowing what 3rd party tools and assets are often being used for solving certain problems.
     
    Gekigengar likes this.
  4. CodeWurm

    CodeWurm

    Joined:
    Nov 8, 2014
    Posts:
    194
    You talking about the UnityEngine subsection from the Scripting Api.
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,540
    In the first part I'm talking about the main manual. In my opinion it is a good idea to read most of it, so you are aware of what Unity can do for you, compared to what isn't in there is probably what you need to focus on building yourself.
    https://docs.unity3d.com/Manual/

    When I'm talking about the scripting reference, I'm talking about looking up exactly how to use the various API's. Yes most of that is under UnityEngine, but you may need UnityEditor, etc.