Loop Classification

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By display

can I classify a variable in a loop? like this

for v:Node3D in get_children():
:bust_in_silhouette: Reply From: jgodfrey

Not that I’m aware of (and definitely not with that syntax). Something like this should work however (assuming I understand what you’re trying to do):

for v in get_children():
	if v is Node3D:
		print(v.name)