+2 votes

Hello,

is the group option some kind of equivalent to tags in unity( or is there something else that has the same goal??)

enter image description here
is there a demo/tutorial for these kind of tools ?

thanks

in Engine by (38 points)

1 Answer

+7 votes
Best answer

You can tag a node with code via the set_meta command. This is closer to Unity's tag system. For example:

myNode.set_meta("type", "enemy")    # set myNode type to "enemy"
var getType = myNode.get_meta("type")    # get the type of myNode

The advantage of the groups system is that you can create them visually via the Group Editor as well as via code. You can also return a list of nodes in a group using the getnodesin_group command, which is more difficult to do using metatags.

There is a small amount of documentation on groups at http://docs.godotengine.org/en/latest/tutorials/step_by_step/scripting_continued.html

by (268 points)
edited by
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.