Random beginner-question: make nodes in group unpickable

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

Hi everyone,

get_node("Area2D").input_pickable = false works.
get_tree().get_nodes_in_group("all-area2d-nodes").input_pickable = false doesn’t.
How can I make such a group (un)pickable?

:bust_in_silhouette: Reply From: jgodfrey

Just iterate through each node in the group and set the input_pickable property. So, something like:

for node in get_tree().get_nodes_in_group("all-area2d-nodes"):
    node.input_pickable = false;

Perfect, thank you!
(Potentially stupid: this “;” isn’t really necessary, is it?)

pferft | 2020-11-18 16:41

Correct, the ; is not required in gdscript (though it is tolerated). It is required by many C-based languages, and my fingers tend to automatically add it if I’m not careful… :slight_smile:

jgodfrey | 2020-11-18 16:45

I envy you ; )

pferft | 2020-11-18 16:48