var means Variant, it can store almost any datatype.
Godot's core types used C language standard C99, such as uint8_t
,uint32_t
,int64_t
, etc.
And, including C99 datatype, Variant type can store those list below:
- Container type: Vector List Set Map
- String
- StringName
- Math types: Vector...
- NodePath
- RID
So, var i
meaning i
can be int
, uint8
, String
, Vector2i
... except for you specify a type explicitly, or use type inferred symbol :=
.
var integer: int = 99
var another := 99
###### below one will cause error:
###### Parse Error: Value of type "String" cannot be assigned to a variable of type "int".
another = "pine"

Ref.
- godot\3.5.1-stable\core\variant.h
- godot\master\core\variant\variant.h