Godot - Get node type
GDScript code example to get node type.
Can get node type with get_class()
in GDScript.
var node = get_node("Sprite2D")
var node_type = node.get_class()
# Sprite2D
If target specified in get_class()
is not a node, "Invalid call" error occurs.
var x = 12
var node_type = x.get_class()
# Invalid call. Nonexistent function 'get_class' in base 'int'.