Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question How to fix variable names in list cut off in the inspector?

Discussion in 'Visual Scripting' started by Marou1, Sep 24, 2022.

  1. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    49
    Hi,

    Is there a way to fix the issue below:
    CutOff.png

    Sorry if the question is trivial or was already answered, but I searched for an answer with no result. Maybe I am not using the right keywords to describe the issue.

    Thanks
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    29,637
    Depends who is drawing that. Usually if you expand the width of the window it gets better.

    If it doesn't then maybe there is a custom editor that requires tweaking.
     
  3. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    49
    Thank you for the quick answer.
    I've already increased the inspector window width.
    But I cannot find a way to increase the Variables section width
    CutOff2.png

    You mentioned a tweaking a custom Editor. Could you provide more information?
    I read the documentation, And I am not sure to understand, I use C sharp script only to define new classes, otherwise I use visual scripting for my project. This is an example of one of my classes:

    Code (CSharp):
    1. using System;
    2. using System.Collections.Generic;
    3. using Unity.VisualScripting;
    4. using UnityEngine;
    5.  
    6. [Inspectable, Serializable]
    7. public class MenuAndCorrespondingInventory
    8. {
    9.     [Inspectable]
    10.     public GameObject Menu;
    11.     [Inspectable]
    12.     public GameObject Inventory;
    13.     [Inspectable]
    14.     public GameObject ListOfButtonsOfMenu;
    15.     [Inspectable]
    16.     public string PrefixUI;
    17. }
    18.  
    Should I add the code provided in the documentation in every class I have defined to be able to see it properly in the inspector?

    Thanks!
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    29,637
    You can google up custom editors... this may or may not be what is going on.

    It might be that there is already tweaks you can make but I haven't used the Visual scripting yet.

    Perhaps these guys can help?

    https://forum.unity.com/forums/visual-scripting.537/

    You can report your own post and ask the mods to move it over there.
     
  5. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    49
    I mentioned the visual scripting just to say I am not a programmer. But the issue I am mentioning is not related to visual script so I didn't want to post on that forum.

    I'm maybe wrong, but it seems like it is a basic issue. Anyone who would define a custom class and create a list of object of that class won't be able to see it correctly in the inspector.
    And the issue seems a generic one: the Variables section does not stretch to fit the width of the inspector window, as shown in my previous screenshot.

    If there is no quick fix for the UI bug, I will live with it and check the class to see what are the names of each field.

    Thanks
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    29,637
  7. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    49
    Oh ok! I didn't know that! Thank you for your patience. :)
    I will ask to move this post the visual scripting forum.
     
    Kurt-Dekker likes this.
  8. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    221
    I don't see any way to expand the label width on the variables.
    You can click and drag out the window, but it only scales the text input box and not the label.

    I would imagine because most of the built in types do not have this tag issue and seem to be labled in such a way to fit into the slot without needing the drag. Mind you it would be a pain having to drag that out every time to see it all.

    I would probably just use shorter keywords if it bugged me.
    because im lazy like that lol
     
  9. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    895
  10. REDACT3D_

    REDACT3D_

    Joined:
    Nov 8, 2020
    Posts:
    221
    Interesting reading, thanks.

    I wonder if a tool-tip would be easier to see then manually setting the size of the rects O.O
    like mouse hover over the variable and tool tip pops up quicky to display the value under it.

    maybe use the thing that scales the width in relation to the number of characters as the other inputs seem to do.
     
    Last edited: Sep 25, 2022
  11. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    49
    Thank you for the documentation link. I will look at it more in details, but my impression is that I will have to create a property drawer for each one of my custom classes, and there are many of them.

    Also I don't understand the first sentence:
    If you want to use a custom type from a custom class in Visual Scripting, and you don't have access to its source code, you must create a custom PropertyDrawer.

    I do have access to the source code since I created the custom classes in c# scripts...
    I don't know what is a type :oops:

    Thanks