Material Box

Material Box

WEB Design & Material Images

Godot - Check node type

Godot

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")

Godot

TitleGodot - Check node type

CategoryGodot

Created

Update

AuthorYousuke.U