---
tags:
    - "UI, User, Interface, Checkbox"
---

# Set Toggle Group Allow Switch Off

[UI](../../index.md) / [Interaction](../index.md) / [Toggle Group](index.md) / **Set Toggle Group Allow Switch Off**

## Description

Sets the Allow Switch Off property of Toggle Group component

## Parameters

| Name | Description |
| :--- | :---------- |
| Toggle Group |  |
| Value |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Set Toggle Group Allow Switch Off")]
    [Category("UI/Interaction/Toggle Group/Allow Switch Off")]
    [Description("Sets the Allow Switch Off property of Toggle Group component")]
    
    [Image(typeof(IconToggleGroup), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface, Checkbox")]
    
    [Parameter("Toggle Group")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenInstructionBool_ToggleGroup_SetAllowSwitchOff : Instruction
    {
        [SerializeField] private GetGameObject m_ToggleGroup = new GetGameObject(
            new GenTypeGameObject_ToggleGroup()
        );
        
        [SerializeField] private GetBool m_Value = new GetBool();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Allow Switch Off");
            return $"{this.m_ToggleGroup} {member} = {this.m_Value}";
        }
        
        protected override Awaitable Run(Args args)
        {
            ToggleGroup component = this.m_ToggleGroup.Get<ToggleGroup>(args);
            if (component == null) return Done;
            
            component.allowSwitchOff = (bool) this.m_Value.Get(args);
            
            return Done;
        }
    }
}


```

