The most important data type in Godot.
A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time. Instead, they are used mainly for communication, editing, serialization and moving data around.
Containers (:ref:`Array<class_Array>` and :ref:`Dictionary<class_Dictionary>`): Both are implemented using variants. A Dictionary can match any datatype used as key to any other datatype. An Array just holds an array of Variants. Of course, a Variant can also hold a Dictionary and an Array inside, making it even more flexible.
Modifications to a container will modify all references to it. A Mutex should be created to lock it if multi-threaded access is desired.
© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.