0 votes

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?

in Engine by (365 points)

1 Answer

0 votes
Best answer

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;
by (10,914 points)
selected by

Perfect, thank you!
(Potentially stupid: this ";" isn't really necessary, is it?)

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... :)

I envy you ; )

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.