Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Variable in script but not in Inspector

Discussion in 'Scripting' started by dan_soqqle, Sep 30, 2023.

  1. dan_soqqle

    dan_soqqle

    Joined:
    Feb 2, 2022
    Posts:
    112
    Hi, I've been seeing these in a few different instances and thought i'd post to check.

    I add new variables to a script and they do not appear in inspector. It happens to packages that i download and install. This one dosen't seem to have a namespace and i am not sure what is affecting it. Kind of driving me nuts!

    Maybe some other override? There are no compilation errors and the game plays normal.

    Script:
    upload_2023-9-30_8-29-26.png

    upload_2023-9-30_8-29-44.png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,298
    I bet there is.

    Make sure your log console selector buttons are enabled. See this graphic:

    https://forum.unity.com/threads/cant-add-script-component.632746/#post-4239121

    https://forum.unity.com/threads/update-function-not-working.953477/#post-6215873

    Otherwise, rename one of the other fields. Does it change?

    Or reimport all...

    EDIT: it's possible they package maker made a custom editor for this... look around for one, probably by finding all references of the class type...
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,163
    If you install a package through the package manager, it usually gets installed in a central location for all your projects to use. If you want to modify the scripts in the package and have those changes stay, you need to copy that package from the central location into the individual projects package folder. Then you can make changes to it without it restoring the file.
     
    MaskedMouse and Kurt-Dekker like this.
  4. Deleted User

    Deleted User

    Guest

    Are you sure you saved your script?
     
  5. dan_soqqle

    dan_soqqle

    Joined:
    Feb 2, 2022
    Posts:
    112

    Hmm i edited the tooltip and it was updated. Didn't try the whole field! i'd do that.
    Custom editor.. not sure where to find that. but will see if i can find the references!