Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why is my code auto finishing

Discussion in 'Editor & General Support' started by propz, Mar 15, 2019.

  1. propz

    propz

    Joined:
    Mar 15, 2019
    Posts:
    4
    When i type ex: "a" and press space it makes a word.

    For example when i want to type this: a = 5 it does abstract = 5.
    It does that with all letters.
    I want to turn it off.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. propz

    propz

    Joined:
    Mar 15, 2019
    Posts:
    4
  4. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    The reason that happens is because "a" is not valid code, unless you've already declared a variable named "a". If you instead type "var a", you will be declaring a new variable and intellisense will not auto-complete it for you.
     
    Vryken, Joe-Censored and LaneFox like this.
  5. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Also make sure you're in the right scope. Typing out in space autocomplete will try to make sense of what you're writing and it doesn't make sense what you're trying to write so make sure you're writing where it does make sense.
     
  6. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    Some languages declare their variables or references by setting an arbitrary string of text equal to something.
    C# is not one of those languages.

    Variables/References must be declared in the syntax:
    <type> <value>


    Example:
    Code (CSharp):
    1. int a;
    2. string b;
    3. float c;
    4.  
    5. GameObject d;
    6. Transform e;
    7. Rigidbody f;