Search Unity

Question How do I create a boolean field in UIToolkit

Discussion in 'Scripting' started by Deleted User, Feb 25, 2024.

  1. Deleted User

    Deleted User

    Guest

    I must be missing something simple because I cannot seem to figure out how to make a boolean field in either UXML or C#. It looks like UnityEngine.UIElements.BaseBoolField is an abstract class, but why would I need to make my own class that inherits from this just to be able to generate a bool field?
     
  2. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    595
    https://docs.unity3d.com/ScriptReference/UIElements.Toggle.html
     
    CodeSmile and Deleted User like this.