Click or drag to resize

NodeAddToGroup Method

Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see IsInsideTree). See notes in the description, and the group methods in SceneTree.

The persistent option is used when packing node to PackedScene and saving to file. Non-persistent groups aren't stored.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public void AddToGroup(
	string group,
	bool persistent = false
)

Parameters

group
Type: SystemString

[Missing <param name="group"/> documentation for "M:Godot.Node.AddToGroup(System.String,System.Boolean)"]

persistent (Optional)
Type: SystemBoolean

[Missing <param name="persistent"/> documentation for "M:Godot.Node.AddToGroup(System.String,System.Boolean)"]

See Also