How to solve attempt to call function error 'add_child' in base 'null instance' on null instance e

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

Hello Godoters,
I have just started making a text game.I’m learning from one guy on youtube (here is the link and here is the code:
extends Control

const InputResponse = preload(“res://InputResponse.tscn”)

onready var history_rows = $“Background/MarginContainer/Rows/GameInfo/ScrollContainer/HistoryRow”

func _on_Input_text_entered(new_text: String) → void:
var input_response = InputResponse.instance()

I came to the point where I have to add a scroll bar into my game.
I have followed all his instructions but it doesn’t work.The engine keeps showing attempt to call function error ‘add_child’ in base ‘null instance’ on null instance.

:bust_in_silhouette: Reply From: kidscancode

“null instance” is what you get when you get_node() something that doesn’t exist. Since you’re calling add_child() on history_rows, that means that


is an invalid path.