Material Box

Material Box

WEB Design & Material Images

Godot - Check if variable is Node

Godot

GDScript code example to check if variable contains Node with if~is statement.


Can check if variable contains Node with if~is statement in GDScript.

All Nodes are identified as "Node" with if~is statement.

var node = get_node("Sprite2D")

if node is Node:
	print("node is Node")
else:
	print("Not a Node")

Godot

TitleGodot - Check if variable is Node

CategoryGodot

Created

Update

AuthorYousuke.U