---
tags:
    - "Not"
    - "!"
---

# Invert

[Math](index.md) / **Invert**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns True if the value is False and vice versa

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Invert")]
    [Category("Math/Invert")]
    
    [Description("Returns True if the value is False and vice versa")]
    [Image(typeof(IconToggleOff), ColorTheme.Type.Yellow, typeof(BadgeArrowLeft))]
    
    [Keywords("Not", "!")]
    
    [Serializable]
    public class TypeBoolMathInvert : TypeBool
    {
        [SerializeField] private GetBool m_Value = new GetBool();

        public override bool GetPreview(GameObject source) => !this.m_Value.GetPreview(source);

        public override bool Get(Args args) => !this.m_Value.Get(args);

        public override string ToString()
        {
            return $"Invert {this.m_Value}";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
```

