Can't add child, 10k error in debugger

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mikbauer

I am getting error can’t add child . but am not sure why. the code works but it generates thousands of the same error.

# This file
var note= load("res://noteVew.tscn")

func _process(delta):

func genButtons():
	for i in numberOfNotesInDisplay:
		modeNotes[i].text = str(modText[MOD][i])

ERROR 0:00:02.814   add_child: Can't add child 'noteVew' to 'ModeDisplay', already has a parent 'ModeDisplay'.
  <C++ Error>   Condition "p_child->data.parent" is true.
  <C++ Source>  scene/main/node.cpp:1282 @ add_child()
  <Stack Trace> @ genButtons()
       @ _process()
:bust_in_silhouette: Reply From: mikbauer

I figured it out: I am creating the noteVew inside _process. To fix it. I put the creation modeNotes.append(note.instance()) and add_child(modeNotes[i] under _ready.