Material Box

Material Box

WEB Design & Material Images

Godot - Get node type

Godot

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'.

Godot

TitleGodot - Get node type

CategoryGodot

Created

Update

AuthorYousuke.U