Skip to content

Groups not showing at editor when created using add_to_group() #72486

@Firemanarg

Description

@Firemanarg

Godot version

4.0-beta16

System information

Windows 10

Issue description

When I try to add a node to a group, by calling function add_to_group() in a @tool script, the group is assigned but is not showing at the editor.

image

@tool
extends Node


func _enter_tree():
	print("Adding to group test")
	add_to_group("test")
	notify_property_list_changed()
	print("Groups: ", get_groups())


func _ready():
	add_to_group("test2")
	print("Groups: ", get_groups())
	pass

image

image

Note: If I try to add manually, it works fine.

image
image

Steps to reproduce

  1. Create a new node
  2. Create a new script to the node
  3. Add @tool to the script
  4. Call function add_to_group() inside _enter_tree() or _ready()

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions