Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Charles Woodhill | |
Old Version | Published before Godot 3 was released. |
im trying to bind to the “selection changed” event inside an editor plugin:
func _enter_tree():
dock = preload("res://xxx.tscn").instance()
dock.set_name("somename");
add_control_to_dock( DOCK_SLOT_RIGHT_BL, dock)
var s
s = get_selection() // seems to work (no error msg)
var arr = s.get_selected_nodes() //seems to work (no error msg)
connect("selection_changed",s,"selected_changed1") //error: described below
func selected_changed1():
...
the error i get when trying to connect to the event is:
ERROR: In Object of type "EditorPlugin": Attempt to connect nonexistent signal "selection_changed" to method "EditorSelection.selected_changed1"
but in editor_data.cpp i find:
void EditorSelection::_bind_methods() {
.....
ADD_SIGNAL(MethodInfo("selection_changed"));
.....
}