Variant

    The most important data type in Godot.

    Description

    A Variant:

    • Can store almost any datatype.
    • Can be hashed, so it can be compared quickly to other variants.
    • Can be used to convert safely between datatypes.
    • Can be used to abstract calling methods and their arguments. Godot exports all its functions through variants.
    • Can be serialized as binary and stored to disk, or transferred via network.
    • Can be serialized to text and use it for printing values and editable settings.
    • Can work as an exported property, so the editor can edit it universally.

    Modifications to a container will modify all references to it. A should be created to lock it if multi-threaded access is desired.