In GDScript how to detect the runtime type of a var?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By chanon
:warning: Old Version Published before Godot 3 was released.

For example, how do I detect if a var is an int or another built in type?

The extends keyword doesn’t seem to work with built in types.

:bust_in_silhouette: Reply From: Mohammad Hadi Aliakb
int typeof ( Variant what )

Returns the internal type of the given Variant object, using the TYPE_* enum in @Global Scope.

That works, thanks!!

chanon | 2016-02-24 04:41