I am going through a tutorial. But the project generate errors because I believe the tutorial is outdated from 2017
I first try to pre-load a scene2 that contains a list item
I try to get node from this preloaded scene
But, error says node not found "number" & "Label"
What is the correct way to get a node or I suspect that the preload scene 2 is not loading.
CODE:
const ListItem = preload("listitem.tscn")
var listIndex = 0
func additem( value):
var item = ListItem.instance()
listIndex += 1
item.get_node("number").text = str( listIndex )
item.get_node("Label").text = value
$ScrollContainer/list.add_child(item)
func _ready():
for i in range(10):
additem("List Text String")