Topic was automatically imported from the old Question2Answer platform.
I have been creating a text game by following the tutorials on youtube(here is the link https://www.youtube.com/watch?v=5gP1eOtR5Kg&t=1205s ) and I came to the point where I have to save the reusable scene by adding it to the GDScript here is the code:
A node doesn’t exist at the node path Background/MarginContainer/Rows/GameInfo/HistoryRows at the time your control node that the script is attached to is _ready().
First try make sure that the NodePath listed above is valid.
If the NodePath above is valid and you are still getting the error, move the node that the script is attached to up in the scene tree so its _ready() function gets called later. Alternatively change your function, so you know that all nodes will be in the scenetree when you attempt to get them:
func _on_Input_text_entered(newtext: String) -> void:
if not history_rows:
history_rows = get_node("Background/MarginContainer/Rows/GameInfo/HistoryRows")
var input_response = InputResponse.instance()