Check if object group exists

Godot Version

v4.3.stable.steam [77dcf97d8]

Question

	if not get_tree().get_nodes_in_group("obstacles").empty():

how do I check if instances of an object group are on the scene?

What’s wrong with the code you provided? It should work.

it shows 2 errors Cannot find property “empty” on base “Array[Node]”. and Function “empty()” not found in base Array[Node].

Just check the docs in such cases :slight_smile:
Correct name of the method is is_empty()

1 Like