Godot - Check node type
GDScript code example to check node type with if~is statement.
Can check node type with if~is statement in GDScript.
Note node categories like "Sprite2D" and "TileMap" also match parent "Node" and "Node2D".
var node = get_node("Sprite2D")
if node is Sprite2D :
print("node is Sprite2D")
elif node is TileMap :
print("node is TileMap")